Community
Participate
Working Groups
I have various ECF projects loaded from HEAD, and there are several exceptions due to using class libraries not defined in your bundle's EE. There is a preference to enable these errors: Preferences > Plugin Development > API Errors/Warnings > API Use > Invalid references to system libraries: Error. Examples: FileIDFactory references URI, but EE says J2SE 1.3 which doesn't contain URI FileTransferID uses URI#compareTo, which is defined in Java 5, but bundle EE says 1.4. Either the bundle EE's need to be updated, or the code changed to avoid using those class libraries.
Thanks for the report. The use of EE 1.3 should have been replaced with 1.4 when use of URI was added, and since we're using CDC 1.1/Foundation 1.1 as the first EE (and it does include URI), the update to the second EE (1.3 in a couple of cases) was missed. I've updated relevant plugins to specify EE of cdc 1.1 + jre 1.4 for those that were specifying cdc 1.1 + 1.3 previously (and now access/use URI, and so need cdc 1.1 or 1.4). These changes released to HEAD (ECF 3.4 stream). No changes to 3.3 stream (yet). For use of URI.compareTo...1.4 (and cdc 1.1) does/did have a compareTo, and it's signature was int compareTo(Object other) 1.5 introduced compareTo(URI other) In our usage of URI.compareTo...we would like to use cdc 1.1 and 1.4 as minimum...but if I explicitly cast the compareTo URI argument to Object Eclipse gives me a warning about the cast being unnecessary. So what's the appropriate thing to do in this case? Do the Object cast and ignore the warning? Not do the cast? Something else? Thanks.
The compareTo problem is an interesting case. Olivier, do you have any thoughts on that? Without the cast, it will compile as compareTo(URI) when compiling against Java 5, which won't run on Java 1.4. As long as ECF is being built against the lower class library it should actually be fine. It is strange that the class libraries overloaded the method in this way...
I would like to deal with this issue in ECF 3.4 (proposed release on 10/29/2010), so would like an answer to the question posed in comment 1...how would/should we handle URI.compareTo...i.e. cast to Object? Thanks.
(In reply to comment #1) > In our usage of URI.compareTo...we would like to use cdc 1.1 and 1.4 as > minimum...but if I explicitly cast the compareTo URI argument to Object Eclipse > gives me a warning about the cast being unnecessary. So what's the appropriate > thing to do in this case? Do the Object cast and ignore the warning? Not do > the cast? Something else? Thanks. If you have a 1.5 JDK on the classpath, then the cast is necessary to point to the method that is taking java.lang.Object as the parameter. I don't see another way to target the appropriate compareTo(..) method.
(In reply to comment #4) > (In reply to comment #1) > > In our usage of URI.compareTo...we would like to use cdc 1.1 and 1.4 as > > minimum...but if I explicitly cast the compareTo URI argument to Object Eclipse > > gives me a warning about the cast being unnecessary. So what's the appropriate > > thing to do in this case? Do the Object cast and ignore the warning? Not do > > the cast? Something else? Thanks. > If you have a 1.5 JDK on the classpath, then the cast is necessary to point to > the method that is taking java.lang.Object as the parameter. I don't see > another way to target the appropriate compareTo(..) method. The current code in URIID casts to Object for calling URI.compareTo...so that's apparently ok with you? If you respond yes, then I'll resolve this bug...or if you would prefer, please go ahead and resolve yourself.
(In reply to comment #5) > The current code in URIID casts to Object for calling URI.compareTo...so that's > apparently ok with you? If you respond yes, then I'll resolve this bug...or if > you would prefer, please go ahead and resolve yourself. I cannot find the current code for this class. It looks like it is only available using git and I don't have git installed.
(In reply to comment #6) > (In reply to comment #5) > > The current code in URIID casts to Object for calling URI.compareTo...so that's > > apparently ok with you? If you respond yes, then I'll resolve this bug...or if > > you would prefer, please go ahead and resolve yourself. > I cannot find the current code for this class. It looks like it is only > available using git and I don't have git installed. Right, we've moved to git. It's available here: http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/tree/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/URIID.java
Closing this bug. If we should be doing something other than what we are currently doing (i.e. casting to URI.compareTo(Object)), then please just re-open.