You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by ja...@mac.com on 2005/12/30 18:59:56 UTC

using Java 5 for java.util.concurrent & annotations and then generating 1.4 compliant jars?

First a quick bit of background on why Retrotranslator rocks...
http://radio.weblogs.com/0112098/2005/12/29.html#a546

Retrotranslator can take any Java 5 bytecode using generics,  
annotations, auto-boxing, varargs & java.util.concurrent utilities  
and generate regular 1.4 bytecode that runs just fine on Java 1.4.  
The 1.4 bytecode uses backport-util-concurrent.jar for the  
java.util.concurrent stuff, retrotranslator_runtime.jar for other new  
methods added to Java 5 such as new reflection/generics stuff and  
asm.jar is currently used to read the annotations. So if you only use  
the Java 5 concurrent APIs then the only new dependency added on 1.4  
is backport-util-concurrent.

We should be able to create a maven 2 plugin (I've already started)  
which uses Java 5 for the build to make a Java 5 binary but also  
creates a 1.4 compliant binary.
http://svn.mojo.codehaus.org/trunk/mojo/mojo-sandbox/retrotranslator- 
maven-plugin/
We should hopefully be able to run tests against both JVMs for each  
binary too.

Now given that Java 5 concurrent is faster than backport-util- 
concurrent.jar & concurrent.jar it would be good for us to use this  
by default throughout the Geronimo family of projects. Similarly it  
would be extremely useful to start using annotations and generics &  
the new for loop can be handy too.

So I wonder; should we experiment with 1 module using Java 5 and  
creating a 1.4 binary jar? (I'm quite tempted to try this in ActiveMQ  
to see how it goes). If we start with just the java.util.concurrent <- 
 > backport.util.concurrent it'd be fairly easy to switch back again  
later if we hit some showstopper.

Thoughts?

James
-------
http://radio.weblogs.com/0112098/


Re: using Java 5 for java.util.concurrent & annotations and then generating 1.4 compliant jars?

Posted by James Strachan <ja...@mac.com>.
Using Generics, java-util-concurrent & annotations really is a no brainer with retrotranslator; the only real downside I can see is that it means we'll have 1.4 and 1.5 versions of jars. I guess in the grand scheme of things its not the end of the world.

I"ll post an update when I've got the maven plugin working nicely.

James
 
On Wednesday, January 04, 2006, at 00:05AM, Dain Sundstrom <da...@iq80.com> wrote:

>I would love to start using Java 5 as soon as possible.  I have been  
>using the backport-util-concurrent package for a while in xbean and  
>the Java 5 interfaces are really nice to use.  Above all other  
>features, I would love to have generics support in geronimo.   
>Generics give me much more data when creating collections in the IoC  
>code.  Right now, the collection creation code I have is very dumb  
>since it must assume that a collection can contain any object.
>
>-dain
>
>On Dec 30, 2005, at 9:59 AM, jastrachan@mac.com wrote:
>
>> First a quick bit of background on why Retrotranslator rocks...
>> http://radio.weblogs.com/0112098/2005/12/29.html#a546
>>
>> Retrotranslator can take any Java 5 bytecode using generics,  
>> annotations, auto-boxing, varargs & java.util.concurrent utilities  
>> and generate regular 1.4 bytecode that runs just fine on Java 1.4.  
>> The 1.4 bytecode uses backport-util-concurrent.jar for the  
>> java.util.concurrent stuff, retrotranslator_runtime.jar for other  
>> new methods added to Java 5 such as new reflection/generics stuff  
>> and asm.jar is currently used to read the annotations. So if you  
>> only use the Java 5 concurrent APIs then the only new dependency  
>> added on 1.4 is backport-util-concurrent.
>>
>> We should be able to create a maven 2 plugin (I've already started)  
>> which uses Java 5 for the build to make a Java 5 binary but also  
>> creates a 1.4 compliant binary.
>> http://svn.mojo.codehaus.org/trunk/mojo/mojo-sandbox/ 
>> retrotranslator-maven-plugin/
>> We should hopefully be able to run tests against both JVMs for each  
>> binary too.
>>
>> Now given that Java 5 concurrent is faster than backport-util- 
>> concurrent.jar & concurrent.jar it would be good for us to use this  
>> by default throughout the Geronimo family of projects. Similarly it  
>> would be extremely useful to start using annotations and generics &  
>> the new for loop can be handy too.
>>
>> So I wonder; should we experiment with 1 module using Java 5 and  
>> creating a 1.4 binary jar? (I'm quite tempted to try this in  
>> ActiveMQ to see how it goes). If we start with just the  
>> java.util.concurrent <-> backport.util.concurrent it'd be fairly  
>> easy to switch back again later if we hit some showstopper.
>>
>> Thoughts?
>>
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>
>
>

Re: using Java 5 for java.util.concurrent & annotations and then generating 1.4 compliant jars?

Posted by Calvin Austin <ca...@spikesource.com>.
I had a quick look at retrotranslator today. Generics and some other 
language 5.0 features were, as some of you may know, originally 
developed on a 1.4 JVM. So in principal this is a cool idea and at one 
point the javac engineer suggested we provide the target 1.4 option. I 
would probably draw the line at the runtime annotations though myself. 
Achieving this in retrotranslator requires some involved helper classes 
which changes the behavior of the app, before you even get to try a 
debugger on it

regards
calvin



Dain Sundstrom wrote:

> I would love to start using Java 5 as soon as possible.  I have been  
> using the backport-util-concurrent package for a while in xbean and  
> the Java 5 interfaces are really nice to use.  Above all other  
> features, I would love to have generics support in geronimo.   
> Generics give me much more data when creating collections in the IoC  
> code.  Right now, the collection creation code I have is very dumb  
> since it must assume that a collection can contain any object.
>
> -dain
>
> On Dec 30, 2005, at 9:59 AM, jastrachan@mac.com wrote:
>
>> First a quick bit of background on why Retrotranslator rocks...
>> http://radio.weblogs.com/0112098/2005/12/29.html#a546
>>
>> Retrotranslator can take any Java 5 bytecode using generics,  
>> annotations, auto-boxing, varargs & java.util.concurrent utilities  
>> and generate regular 1.4 bytecode that runs just fine on Java 1.4.  
>> The 1.4 bytecode uses backport-util-concurrent.jar for the  
>> java.util.concurrent stuff, retrotranslator_runtime.jar for other  
>> new methods added to Java 5 such as new reflection/generics stuff  
>> and asm.jar is currently used to read the annotations. So if you  
>> only use the Java 5 concurrent APIs then the only new dependency  
>> added on 1.4 is backport-util-concurrent.
>>
>> We should be able to create a maven 2 plugin (I've already started)  
>> which uses Java 5 for the build to make a Java 5 binary but also  
>> creates a 1.4 compliant binary.
>> http://svn.mojo.codehaus.org/trunk/mojo/mojo-sandbox/ 
>> retrotranslator-maven-plugin/
>> We should hopefully be able to run tests against both JVMs for each  
>> binary too.
>>
>> Now given that Java 5 concurrent is faster than backport-util- 
>> concurrent.jar & concurrent.jar it would be good for us to use this  
>> by default throughout the Geronimo family of projects. Similarly it  
>> would be extremely useful to start using annotations and generics &  
>> the new for loop can be handy too.
>>
>> So I wonder; should we experiment with 1 module using Java 5 and  
>> creating a 1.4 binary jar? (I'm quite tempted to try this in  
>> ActiveMQ to see how it goes). If we start with just the  
>> java.util.concurrent <-> backport.util.concurrent it'd be fairly  
>> easy to switch back again later if we hit some showstopper.
>>
>> Thoughts?
>>
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>
>


Re: using Java 5 for java.util.concurrent & annotations and then generating 1.4 compliant jars?

Posted by Dain Sundstrom <da...@iq80.com>.
I would love to start using Java 5 as soon as possible.  I have been  
using the backport-util-concurrent package for a while in xbean and  
the Java 5 interfaces are really nice to use.  Above all other  
features, I would love to have generics support in geronimo.   
Generics give me much more data when creating collections in the IoC  
code.  Right now, the collection creation code I have is very dumb  
since it must assume that a collection can contain any object.

-dain

On Dec 30, 2005, at 9:59 AM, jastrachan@mac.com wrote:

> First a quick bit of background on why Retrotranslator rocks...
> http://radio.weblogs.com/0112098/2005/12/29.html#a546
>
> Retrotranslator can take any Java 5 bytecode using generics,  
> annotations, auto-boxing, varargs & java.util.concurrent utilities  
> and generate regular 1.4 bytecode that runs just fine on Java 1.4.  
> The 1.4 bytecode uses backport-util-concurrent.jar for the  
> java.util.concurrent stuff, retrotranslator_runtime.jar for other  
> new methods added to Java 5 such as new reflection/generics stuff  
> and asm.jar is currently used to read the annotations. So if you  
> only use the Java 5 concurrent APIs then the only new dependency  
> added on 1.4 is backport-util-concurrent.
>
> We should be able to create a maven 2 plugin (I've already started)  
> which uses Java 5 for the build to make a Java 5 binary but also  
> creates a 1.4 compliant binary.
> http://svn.mojo.codehaus.org/trunk/mojo/mojo-sandbox/ 
> retrotranslator-maven-plugin/
> We should hopefully be able to run tests against both JVMs for each  
> binary too.
>
> Now given that Java 5 concurrent is faster than backport-util- 
> concurrent.jar & concurrent.jar it would be good for us to use this  
> by default throughout the Geronimo family of projects. Similarly it  
> would be extremely useful to start using annotations and generics &  
> the new for loop can be handy too.
>
> So I wonder; should we experiment with 1 module using Java 5 and  
> creating a 1.4 binary jar? (I'm quite tempted to try this in  
> ActiveMQ to see how it goes). If we start with just the  
> java.util.concurrent <-> backport.util.concurrent it'd be fairly  
> easy to switch back again later if we hit some showstopper.
>
> Thoughts?
>
> James
> -------
> http://radio.weblogs.com/0112098/


Re: using Java 5 for java.util.concurrent & annotations and then generating 1.4 compliant jars?

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
How does this affect debugging?


Regards,
Alan

On 1/3/2006 8:39 AM, Aaron Mulder wrote:

>That sounds pretty interesting -- does it really fully handle
>annotations?  I thought some of those could be inspected at runtime
>and I'm not sure how that could be supported in 1.4, but I really
>don't know that much about it.
>
>On a similar note, it would be great if someone could look into why
>DayTrader blows up if run under 1.5.
>
>Aaron
>
>On 12/30/05, jastrachan@mac.com <ja...@mac.com> wrote:
>  
>
>>First a quick bit of background on why Retrotranslator rocks...
>>http://radio.weblogs.com/0112098/2005/12/29.html#a546
>>
>>Retrotranslator can take any Java 5 bytecode using generics,
>>annotations, auto-boxing, varargs & java.util.concurrent utilities
>>and generate regular 1.4 bytecode that runs just fine on Java 1.4.
>>The 1.4 bytecode uses backport-util-concurrent.jar for the
>>java.util.concurrent stuff, retrotranslator_runtime.jar for other new
>>methods added to Java 5 such as new reflection/generics stuff and
>>asm.jar is currently used to read the annotations. So if you only use
>>the Java 5 concurrent APIs then the only new dependency added on 1.4
>>is backport-util-concurrent.
>>
>>We should be able to create a maven 2 plugin (I've already started)
>>which uses Java 5 for the build to make a Java 5 binary but also
>>creates a 1.4 compliant binary.
>>http://svn.mojo.codehaus.org/trunk/mojo/mojo-sandbox/retrotranslator-
>>maven-plugin/
>>We should hopefully be able to run tests against both JVMs for each
>>binary too.
>>
>>Now given that Java 5 concurrent is faster than backport-util-
>>concurrent.jar & concurrent.jar it would be good for us to use this
>>by default throughout the Geronimo family of projects. Similarly it
>>would be extremely useful to start using annotations and generics &
>>the new for loop can be handy too.
>>
>>So I wonder; should we experiment with 1 module using Java 5 and
>>creating a 1.4 binary jar? (I'm quite tempted to try this in ActiveMQ
>>to see how it goes). If we start with just the java.util.concurrent <-
>> > backport.util.concurrent it'd be fairly easy to switch back again
>>later if we hit some showstopper.
>>
>>Thoughts?
>>
>>James
>>-------
>>http://radio.weblogs.com/0112098/
>>
>>
>>    
>>



Re: using Java 5 for java.util.concurrent & annotations and then generating 1.4 compliant jars?

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
That sounds pretty interesting -- does it really fully handle
annotations?  I thought some of those could be inspected at runtime
and I'm not sure how that could be supported in 1.4, but I really
don't know that much about it.

On a similar note, it would be great if someone could look into why
DayTrader blows up if run under 1.5.

Aaron

On 12/30/05, jastrachan@mac.com <ja...@mac.com> wrote:
> First a quick bit of background on why Retrotranslator rocks...
> http://radio.weblogs.com/0112098/2005/12/29.html#a546
>
> Retrotranslator can take any Java 5 bytecode using generics,
> annotations, auto-boxing, varargs & java.util.concurrent utilities
> and generate regular 1.4 bytecode that runs just fine on Java 1.4.
> The 1.4 bytecode uses backport-util-concurrent.jar for the
> java.util.concurrent stuff, retrotranslator_runtime.jar for other new
> methods added to Java 5 such as new reflection/generics stuff and
> asm.jar is currently used to read the annotations. So if you only use
> the Java 5 concurrent APIs then the only new dependency added on 1.4
> is backport-util-concurrent.
>
> We should be able to create a maven 2 plugin (I've already started)
> which uses Java 5 for the build to make a Java 5 binary but also
> creates a 1.4 compliant binary.
> http://svn.mojo.codehaus.org/trunk/mojo/mojo-sandbox/retrotranslator-
> maven-plugin/
> We should hopefully be able to run tests against both JVMs for each
> binary too.
>
> Now given that Java 5 concurrent is faster than backport-util-
> concurrent.jar & concurrent.jar it would be good for us to use this
> by default throughout the Geronimo family of projects. Similarly it
> would be extremely useful to start using annotations and generics &
> the new for loop can be handy too.
>
> So I wonder; should we experiment with 1 module using Java 5 and
> creating a 1.4 binary jar? (I'm quite tempted to try this in ActiveMQ
> to see how it goes). If we start with just the java.util.concurrent <-
>  > backport.util.concurrent it'd be fairly easy to switch back again
> later if we hit some showstopper.
>
> Thoughts?
>
> James
> -------
> http://radio.weblogs.com/0112098/
>
>