Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Strange compilation problems with com.sun.jdi.* classes on Gerrit
Strange compilation problems with com.sun.jdi.* classes on Gerrit [message #1692934] Mon, 20 April 2015 16:56 Go to next message
Tamas Szabo is currently offline Tamas SzaboFriend
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.Cool 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

Re: Strange compilation problems with com.sun.jdi.* classes on Gerrit [message #1692935 is a reply to message #1692934] Mon, 20 April 2015 17:10 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
I guess you need to find out against which exact JRE you are compiling on the CI server. Knowing the JRE driving the build is one ingredient to this riddle. Depending on you build technology (tycho?) using a properly configured toolchains.xml could have an impact, too.
mvn -X should reveal the actual locations used by the compiler.

Stephan
Re: Strange compilation problems with com.sun.jdi.* classes on Gerrit [message #1693762 is a reply to message #1692934] Tue, 28 April 2015 08:43 Go to previous messageGo to next message
Tamas Szabo is currently offline Tamas SzaboFriend
Messages: 12
Registered: June 2013
Junior Member
I have attached the log from the build run with the -X flag. I was not able to figure out more about the reason of the compilation failure.
Re: Strange compilation problems with com.sun.jdi.* classes on Gerrit [message #1693776 is a reply to message #1693762] Tue, 28 April 2015 10:42 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
You are compiling against org.eclipse.jdt.debug-3.7.1.v20111006_r372.jar/jdimodel.jar

Please have a look at type ArrayReference in this version: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/tree/org.eclipse.jdt.debug/jdi%20interfaces/com/sun/jdi/ArrayReference.java?h=R3_7_maintenance

See that getValues() returns the raw type "List", hence the elements of this collection have type Object => type error.

You need to bump up your dependencies to consume this change: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/org.eclipse.jdt.debug/jdi%20interfaces/com/sun/jdi/ArrayReference.java?id=ce86425aef2eed46429c175a17472fb1ff9a03da

I think you basically need 3.8 or greater, o.e.j.debug would be 3.7.100 or greater.
Re: Strange compilation problems with com.sun.jdi.* classes on Gerrit [message #1693963 is a reply to message #1692934] Wed, 29 April 2015 15:03 Go to previous message
Tamas Szabo is currently offline Tamas SzaboFriend
Messages: 12
Registered: June 2013
Junior Member
Thanks for the help!
Previous Topic:BUILD CLASSES STRICTLY INCREMENTAL
Next Topic:Templates for Properties files
Goto Forum:
  


Current Time: Thu Dec 26 17:49:07 GMT 2024

Powered by FUDForum. Page generated in 0.03933 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top