JDK6 backwards compatible AutoCloseable from a libraries perspective

Dan Smith daniel.smith at oracle.com
Mon Feb 7 16:21:13 PST 2011


You should definitely take a look at Retroweaver, if you're not aware of it:

<http://retroweaver.sourceforge.net/>

It provides substitute APIs for Java 5 features and performs appropriate transformations to class files as a post-compilation step.

Of course, it won't solve your problem automatically (it doesn't know about Java 7 features; I don't know if it will be updated eventually to handle them).  But it would probably be straightforward to modify its sources appropriately.

—Dan


On Feb 7, 2011, at 5:10 AM, Michael Bien wrote:

>  Hello everyone,
> 
> I would like to support the new try-with-resource feature in jocl while 
> staying backwards compatible with JDK5/6. The problem is that 
> AutoCloseable resides in java.lang which means i have no chance to load 
> the class if i would ship it for jdk5 backwards compatibility.
> 
> Providing two builds for JOCL is not what i would like to do just to be 
> able to be upwards compatible.
> 
> any ideas what i could do in this situation?
> 
> best regards,
> michael
> 
> -- 
> http://jocl.jogamp.org
> http://michael-bien.com/
> 
> 




More information about the coin-dev mailing list