Strange compilation problems with com.sun.jdi.* classes on Gerrit [message #1692934] |
Mon, 20 April 2015 16:56 |
Tamas Szabo Messages: 12 Registered: June 2013 |
Junior Member |
|
|
Context: I am implementing my own Variables View in Eclipse, which will be populated with my custom debug variables.
In order to do this I am heavily using the org.eclipse.debug.* and org.eclipse.jdt.debug plugins along with some classes directly coming from the JDK (com.sun.jdi.ArrayReference, com.sun.jdi.Value, etc).
Consider the ArrayReference class for now:
As of JDK 1.6 this class uses generics, as you can see for example here: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/com/sun/jdi/ArrayReference.java
My code uses this class, for example I am accessing array members through the getValues call (which returns a List<Value>). Now, if I compile this code within Eclipse on OSX/Windows/Linux this works just fine. However, if I push my changes to Gerrit, I always get a compilation problem. I have highlighted some relevant parts of the console output:
...
[/opt/public/common/jdk1.6.0_45/jre/bin/java, -jar, /jobs/genie.incquery/incquery-master-gerrit/workspace/.maven/repo/p2/osgi/bundle/org.eclipse.equinox.launcher (this is important for the Java version)
...
[ERROR] /jobs/genie.incquery/incquery-master-gerrit/workspace/plugins/org.eclipse.incquery.tooling.debug/src/org/eclipse/incquery/tooling/debug/variables/values/MatcherValue.java:[66]
[ERROR] for (Value match : ((ArrayReference) matches.getValue()).getValues()) {
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from element type Object to Value
Here, the matches.getValue() returns an ArrayReference (at least content assist says that inside Eclipse), and then I would call getValues() on this to iterate over the values. This is where the compilation problem happens. I checked my local JDK (both 1.6 and 1. and they provide this class with generics, which is not quite surprising.
Could somebody maybe point me to the right direction about what is going on here? I would appreciate any help.
[Updated on: Mon, 20 April 2015 17:00] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04302 seconds