Hi Ernie,
sorry, but you expect more from binary compatibility than java
provides. The TL;DR version is, that you can't have both: Features from
a newer release and methods from an older release. The same is true for
the JDK. You can compile with "--release 8", but then you don't get
access to new features or you use "-target 8" and "-source 8" but then
you get linked against new methods, which don't exist in JDK 8 (see the
ByteBuffer example).

For your case you can work around it. Change:

   Comparable specVersion = mi.getSpecificationVersion();
   Comparable reqVersion = new SpecificationVersion("9.26");
   if (specVersion.compareTo(reqVersion)) >= 0) { // etc etc

To:

   Method bridgeImplementation = Comparable.class.getMethod("compareTo", 
Object.class);
   Comparable specVersion = mi.getSpecificationVersion();
   Comparable reqVersion = new SpecificationVersion("9.26");
   if (((int)bridgeImplementation.invoke(specVersion, reqVersion)) >= 0) { // 
etc etc
   
Lets hope, that this is the only call to a generified Comparable. Of
course this need to be done for every call, that goes into a generified
method.

Greetings

Matthias

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to