From 2151d7273c435ab37c182563a2f2c2e22854e68b Mon Sep 17 00:00:00 2001 From: Ted Nathan Husted Date: Mon, 29 Oct 2007 13:12:30 +0000 Subject: [PATCH] WW-1715 Update POMs and backport for 2.1.1-SNAPSHOT. git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@589617 13f79535-47bb-0310-9956-ffa450edef68 --- api/pom.xml | 2 +- apps/blank/pom.xml | 2 +- apps/mailreader/pom.xml | 2 +- apps/pom.xml | 2 +- apps/portlet/pom.xml | 2 +- apps/showcase/pom.xml | 2 +- assembly/pom.xml | 2 +- backport/LICENSE.txt | 3 - backport/readme.html | 1290 ++++++++++++++++++++------------ backport/translate.bat | 6 +- core/pom.xml | 6 +- plugins/codebehind/pom.xml | 2 +- plugins/config-browser/pom.xml | 2 +- plugins/dojo/pom.xml | 2 +- plugins/jasperreports/pom.xml | 2 +- plugins/jfreechart/pom.xml | 2 +- plugins/jsf/pom.xml | 2 +- plugins/pell-multipart/pom.xml | 2 +- plugins/plexus/pom.xml | 2 +- plugins/pom.xml | 2 +- plugins/portlet/pom.xml | 2 +- plugins/sitegraph/pom.xml | 2 +- plugins/sitemesh/pom.xml | 2 +- plugins/spring/pom.xml | 2 +- plugins/struts1/pom.xml | 2 +- plugins/tiles/pom.xml | 2 +- pom.xml | 2 +- 27 files changed, 843 insertions(+), 508 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 2d86fbac7..89586d1be 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -27,7 +27,7 @@ org.apache.struts struts2-parent - 2.1.0 + 2.1.1-SNAPSHOT org.apache.struts struts2-api diff --git a/apps/blank/pom.xml b/apps/blank/pom.xml index f78f4743e..62c4bcfd9 100644 --- a/apps/blank/pom.xml +++ b/apps/blank/pom.xml @@ -27,7 +27,7 @@ org.apache.struts struts2-apps - 2.1.0 + 2.1.1-SNAPSHOT org.apache.struts struts2-blank diff --git a/apps/mailreader/pom.xml b/apps/mailreader/pom.xml index a4852dfc3..6d467d59d 100644 --- a/apps/mailreader/pom.xml +++ b/apps/mailreader/pom.xml @@ -27,7 +27,7 @@ org.apache.struts struts2-apps - 2.1.0 + 2.1.1-SNAPSHOT org.apache.struts struts2-mailreader diff --git a/apps/pom.xml b/apps/pom.xml index 7b99fffdf..77d1093ea 100644 --- a/apps/pom.xml +++ b/apps/pom.xml @@ -28,7 +28,7 @@ org.apache.struts struts2-parent - 2.1.0 + 2.1.1-SNAPSHOT org.apache.struts struts2-apps diff --git a/apps/portlet/pom.xml b/apps/portlet/pom.xml index 86be10038..3fa240c5d 100644 --- a/apps/portlet/pom.xml +++ b/apps/portlet/pom.xml @@ -27,7 +27,7 @@ org.apache.struts struts2-apps - 2.1.0 + 2.1.1-SNAPSHOT org.apache.struts struts2-portlet diff --git a/apps/showcase/pom.xml b/apps/showcase/pom.xml index ba1f97ae1..d8b5d3487 100644 --- a/apps/showcase/pom.xml +++ b/apps/showcase/pom.xml @@ -27,7 +27,7 @@ org.apache.struts struts2-apps - 2.1.0 + 2.1.1-SNAPSHOT org.apache.struts struts2-showcase diff --git a/assembly/pom.xml b/assembly/pom.xml index fbeff0330..76f8c03d5 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -33,7 +33,7 @@ org.apache.struts struts2-parent - 2.1.0 + 2.1.1-SNAPSHOT diff --git a/backport/LICENSE.txt b/backport/LICENSE.txt index 2f07ce8fc..d8ec3ab3c 100644 --- a/backport/LICENSE.txt +++ b/backport/LICENSE.txt @@ -1,6 +1,3 @@ - Retrotranslator: a Java bytecode transformer that translates Java classes - compiled with JDK 5.0 into classes that can be run on JVM 1.4. - Copyright (c) 2005 - 2007 Taras Puchko All rights reserved. diff --git a/backport/readme.html b/backport/readme.html index 1f6b4d727..c1d8b35d1 100644 --- a/backport/readme.html +++ b/backport/readme.html @@ -3,57 +3,62 @@ Retrotranslator - - + +

Retrotranslator

SourceForge.net Logo   + The best Java IDE +
-

Contents

  1. What is Retrotranslator?
  2. What Java 5 features are supported?
  3. How to use Retrotranslator from a command line?
  4. +
  5. How to produce a JAR file compatible with J2SE 1.4?
  6. How to use Retrotranslator from Apache Ant or Maven?
  7. How to use Retrotranslator from IntelliJ IDEA?
  8. How to use Just-in-Time Retrotranslator?
  9. -
  10. What Java 5 classes and methods are supported?
  11. -
  12. How to write an extension for Retrotranslator?
  13. +
  14. What API is supported on J2SE 1.4?
  15. +
  16. How to write an extension?
  17. What are the limitations?
  18. Alternative tools
  19. Contact
  20. License
-

What is Retrotranslator?

-Retrotranslator is a Java bytecode transformer -that translates Java classes compiled with JDK 5.0 into classes that can be run on JVM 1.4. -It is a free, open-source tool based on the ASM bytecode manipulation framework -and concurrency utilities -backported to Java 1.4. +

+ Retrotranslator is a tool that makes Java applications compatible with various versions of the Java platform. + It supports all Java 5 language features and a significant part of Java 5 API on J2SE 1.4. In other Java + environments only the Java 5 language features that does not require new API are supported. + Retrotranslator is based on the ASM bytecode manipulation framework and the + backport of concurrency utilities. +

What Java 5 features are supported?

-

How to use Retrotranslator from a command line?

  1. Download @@ -61,7 +66,7 @@ and concurrency utilities where n.n.n is the latest Retrotranslator release number.
  2. - Compile your classes with JDK 5.0 and put them into some directory, e.g. myclasses. + Compile your classes with Java 5 or later and put them into some directory, e.g. myclasses.
  3. Go to the unzipped directory and execute:
    @@ -72,235 +77,179 @@ and concurrency utilities backport-util-concurrent-n.n.jar into the classpath of your application.
  4. - Run or debug the application as usual on J2SE 1.4.x, preferably 1.4.2. + Run or debug the application as usual on J2SE 1.4.x.
- -

The full command line syntax:
+

The command line syntax:
java -jar retrotranslator-transformer-n.n.n.jar <options>
or
- java -cp retrotranslator-transformer-n.n.n.jar net.sf.retrotranslator.transformer.Retrotranslator <options>

+ java -cp retrotranslator-transformer-n.n.n.jar + net.sf.retrotranslator.transformer.Retrotranslator <options>

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescriptionDefault
-srcdirThe directory with classes that should be translated (may be specified several times).-
-srcjarThe directory with classes that should be translated (may be specified several times).-
-destdirThe directory to place translated classes.Location of sources
-destjarThe JAR file to place translated classes.Location of sources
-advancedWhether to use alternative implementations of Java 1.4 classes and methods for better Java 5 compatibility.Off
-verifyAsks the translator to examine translated bytecode for references to classes, methods, or fields - that cannot be found in the provided classpath.Off
-classpathThe classpath for verification including rt.jar, jce.jar, - jsse.jar (from JRE 1.4), retrotranslator-runtime-n.n.n.jar, - and backport-util-concurrent-n.n.jar.Current classpath
-srcmaskThe wildcard pattern specifying files that should be translated (either bytecode or UTF-8 text), - e.g. "*.class;*.tld". There are three special characters: "*?;". - *.class
-embedPackage name for a private copy of retrotranslator-runtime-n.n.n.jar and - backport-util-concurrent-n.n.jar to be put into -destdir or -destjar. - This makes your application independent of other versions of Retrotranslator present in the classpath. - -
-backportInforms the translator about user-defined backport packages. - Package names should be separated by semicolons.-
-targetTo make Java 6 classes compatible with Java 5 set this option to 1.5 and supply - user-defined backport packages via the backport option.1.4
-lazyAsks the translator to only transform classes compiled with a target greater than the current one.Off
-stripsignAsks the translator to strip signature (generics) information.Off
-verboseAsks the translator for verbose output.Off
-retainapiAsks the translator to modify classes for JVM 1.4 compatibility but keep use of Java 5 API. - References introduced by a compiler will also remain unchanged, - like the use of java.lang.StringBuilder for string concatenation - or the implicit valueOf method call for autoboxing.Off
-retainflagsAsks the translator to keep Java 5 specific access modifiers.Off
OptionDescriptionDefault
-srcdir <path>The directory with the files to process (may be specified several times).-
-srcjar <file>The JAR archive file with the files to process (may be specified several times).-
-destdir <path>The directory to place processed files.The source directory.
-destjar <file>The JAR archive file to place processed files.The source JAR file.
-srcmask <mask>The wildcard pattern specifying the files to transform rather than copy + (classes or UTF-8 text files), e.g. *.class;?*.tld. + *.class
-target <version>The version of the JVM where classes should be able to run. The supported targets are + 1.1, 1.2, 1.3, 1.4, and 1.5. While API support is available only for the 1.4 target, + user-defined backport classes may be used for other targets as well. + 1.4
-classpath <path>The dependencies of the translated classes, including the target JVM and Retrotranslator itself. + The following files should be specified among others if the target is Sun JRE 1.4: rt.jar, + jce.jar, jsse.jar, retrotranslator-runtime-n.n.n.jar, + and backport-util-concurrent-n.n.jar. + This option may be omitted if the current Java environment matches the target one. + The current classpath.
-verifyAsks the translator to examine translated bytecode for references to classes, methods, or fields + that cannot be found in the classpath. + false
-support <features>Enables advanced features. The names specified should be separated with semicolons, e.g. + ThreadLocal.remove;BigDecimal.setScale. + -
-advancedEnables all advanced features at once, but it's recommended to enable only required features + in order to avoid compatibility issues. + false
-smartMakes all backport classes inheritable provided that the classpath + correctly reflects the target environment. + For example, the backport of the Writer.append(String) method may be used + to translate the following expression: new FileWriter("file.tmp").append("Hello"). + false
-backport <names>The backport names separated with semicolons, e.g. + com.myco.all;java.util:com.myco.ju;javax.net.SocketFactory:com.myco.jsse.Factory. + The corresponding backport classes must be present in the classpath. + -
-embed <package>The package name for a partial copy of retrotranslator-runtime-n.n.n.jar and + backport-util-concurrent-n.n.jar to be put along with translated classes. + This makes an application independent of other versions of Retrotranslator present in the classpath. + -
-lazyAsks the translator to transform and verify only the classes compiled with a target greater than the + current one. + false
-stripsignAsks the translator to strip signature (generics) information.false
-verboseAsks the translator for verbose output.false
-retainapiAsks the translator to modify classes for JVM compatibility but keep use of API + unless the backport option is specified. + Any references introduced by a compiler remain unchanged, like the use of + java.lang.StringBuilder for string concatenation or + the implicit valueOf method calls for autoboxing. + false
-retainflagsAsks the translator to keep Java 5 specific access modifiers.false
-uptodatecheckAsks the translator to skip processing of files if the destination files are newer.false
+

How to produce a JAR file compatible with J2SE 1.4?

+

- For example, if you have a Java 5 application myapplication5.jar you can use the following command - to produce myapplication4.jar that will run on J2SE 1.4 and is independent of Retrotranslator, - since required classes are added to the translated application with a different package name: + If you have myapplication5.jar file built with Java 5 you can use the following command to produce + myapplication4.jar. It will be compatible with Java 1.4 and independent of Retrotranslator because + backport classes are added to the translated application with a different package name:

+

java -jar retrotranslator-transformer-n.n.n.jar - -srcjar myapplication5.jar -destjar myapplication4.jar -embed com.mycompany.internal
+ -srcjar myapplication5.jar -destjar myapplication4.jar -embed com.mycompany.internal

+

+ Also it is recommended to specify the classpath and + verify options. In case of verification failure try the + smart and advanced options. +

How to use Retrotranslator from Apache Ant or Maven?

-

The distribution contains an integrated Apache Ant task - net.sf.retrotranslator.transformer.RetrotranslatorTask. It has the following syntax:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionDefault
srcdirThe directory with classes that should be translated.-
srcjarThe directory with classes that should be translated.-
destdirThe directory to place translated classes.Location of sources
destjarThe JAR file to place translated classes.Location of sources
advancedWhether to use alternative implementations of Java 1.4 classes and methods for better Java 5 compatibility.Off
verifyAsks the translator to examine translated bytecode for references to classes, methods, or fields - that cannot be found in the provided classpath.Off
classpathThe classpath for the verification, including rt.jar, jce.jar, - jsse.jar (from JRE 1.4), retrotranslator-runtime-n.n.n.jar, - and backport-util-concurrent-n.n.jar. - Current classpath
classpathrefThe classpath for the verification, given as a reference to a path defined elsewhere. - Current classpath
srcmaskThe wildcard pattern specifying files that should be translated (either bytecode or UTF-8 text), - e.g. "*.class;*.tld". There are three special characters: "*?;". - *.class
embedPackage name for a private copy of retrotranslator-runtime-n.n.n.jar and - backport-util-concurrent-n.n.jar to be put into -destdir or -destjar. - This makes your application independent of other versions of Retrotranslator present in the classpath. - -
backportInforms the translator about user-defined backport packages. - Package names should be separated by semicolons.-
targetSet this option to 1.5 and supply user-defined backport packages via - the backport option to make Java 6 classes compatible with Java 5.1.4
lazyAsks the translator to only transform classes compiled with a target greater than the current one.Off
stripsignAsks the translator to strip signature (generics) information.Off
verboseAsks the translator for verbose output.Off
retainapiAsks the translator to modify classes for JVM 1.4 compatibility but keep use of Java 5 API. - References introduced by a compiler will also remain unchanged, - like the use of java.lang.StringBuilder for string concatenation - or the implicit valueOf method call for autoboxing.Off
retainflagsAsks the translator to keep Java 5 specific access modifiers.Off
failonwarningIndicates whether the build will fail when there are verification warnings.On
-

- You may use nested fileset, jarfileset, and dirset elements to specify - source files and classpath elements to specify classpath. For example: +

The distribution contains an Apache Ant task + net.sf.retrotranslator.transformer.RetrotranslatorTask. Every command line + option can be set using the corresponding attribute. In addition the source files can be specified with nested + fileset, jarfileset, and dirset elements and the + classpath can be set with nested classpath + elements or the classpathref attribute. + The source directories specified with srcdir, dirset, + and the dir attribute of fileset should contain the root package of the classes. + In case of warnings the build fails unless the value of + the failonwarning attribute is set to false. For example:

     <path id="classpath">
@@ -308,7 +257,7 @@ and concurrency utilities
     </path>
     <taskdef name="retrotranslator" classpathref="classpath"
              classname="net.sf.retrotranslator.transformer.RetrotranslatorTask" />
-    <retrotranslator destdir="build/classes14" verify="true">
+    <retrotranslator destdir="build/classes14" verify="true" failonwarning="false">
         <fileset dir="build/classes15" includes="**/*.class">
         <jarfileset dir="build/lib15" includes="**/*.jar">
         <classpath location="${java14_home}/jre/lib/rt.jar"/>
@@ -321,297 +270,690 @@ and concurrency utilities
     from the Mojo Project.
 

How to use Retrotranslator from IntelliJ IDEA?

+

There is a plugin to automatically translate and verify classes compiled by IntelliJ IDEA, so you can develop in Java 5 but run and debug on JRE 1.4.

-

How to use Just-in-Time Retrotranslator?

-

- JIT Retrotranslator is able to translate at runtime Java classes loaded with any classloader. - It works on J2SE 1.4 from most JVM vendors like Sun, IBM, BEA, and Apple, but does nothing on J2SE 5.0. - However translation at runtime consumes additional memory and processing resources and it will not - work if your classes make use of Java 5 API but were compiled with "-target 1.4". + In order to run a Java 5 application on J2SE 1.4 start it with JIT Retrotranslator:

  • - If you want to run a JAR file with the JIT, execute:
    java -cp retrotranslator-transformer-n.n.n.jar - net.sf.retrotranslator.transformer.JITRetrotranslator <options> -jar <jarfile> [<args...>] + net.sf.retrotranslator.transformer.JITRetrotranslator + <options> -jar <jarfile> [<args...>]
  • - When the first option does not work or if you just want to run a class from your classpath, execute:
    java -cp retrotranslator-transformer-n.n.n.jar:<classpath> - net.sf.retrotranslator.transformer.JITRetrotranslator <options> <class> [<args...>] -
  • -
  • - Alternatively you may simply call JITRetrotranslator.run() from some JVM 1.4 compatible class - before Java 5 classes are loaded. + net.sf.retrotranslator.transformer.JITRetrotranslator + <options> <class> [<args...>]

- JIT Retrotranslator can accept the advanced - and backport options. + The options can include support, + advanced, smart, and + backport. When running on J2SE 5.0 JIT Retrotranslator simply calls + the application, but on J2SE 1.4 it also translates classes compiled for Java 5 or later. However this capability + depends on the current JVM and the application itself, so under certain conditions JIT Retrotranslator may be unable + to translate either a JAR file or classes from the classpath or both.

-

What Java 5 classes and methods are supported?

+

What API is supported on J2SE 1.4?

- - - - - - - - - + + + + + + + + + + + + + + + + + + + - + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageClassMethods and fieldsCompatibility notes
java.lang.annotation* (all classes)* (all methods) 
java.lang.instrument* (all classes)* (all methods) - Bytecode instrumentation is not implemented.
java.util.concurrent,
java.util.concurrent.atomic,
java.util.concurrent.locks
almost all classes1almost all methodsThe LockSupport class may be unusable due to poor efficiency. - The Condition.awaitNanos(long) method has - - little accuracy guarantees.
java.ioCloseable2 - * 
Flushable2* 
PrintStream +
PackageClassMethods and fieldsCompatibility notes
java.ioCloseable2 + * (all methods) 
Flushable2* 
PrintStream * (11 new methods and constructors) -  
PrintWriter +  
PrintWriter * (11 new methods and constructors) - + The PrintWriter.format and PrintWriter.printf methods always flush the output buffer. -
Readerread(CharBuffer) 
Writer - append(CharSequence),
- append(CharSequence, int, int),
- append(char)
-
 
java.langAppendable2* -  
BooleanparseBoolean(String),
- compareTo(Boolean)
 
BytevalueOf(byte) 
CharactervalueOf(char) 
Class* (21 new methods) - Class.getMethod(String, Class...) and Class.getDeclaredMethod(String, Class...) - are intercepted to better support generics and covariant return types - on several platforms3. -
Deprecated* 
DoublevalueOf(double) 
Enum* 
FloatvalueOf(float) 
IllegalArgumentExceptionIllegalArgumentException(String, Throwable),
- IllegalArgumentException(Throwable)
 
IllegalStateExceptionIllegalStateException(String, Throwable),
- IllegalStateException(Throwable)
 
IntegervalueOf(int), signum(int) 
Iterable2* 
LongvalueOf(long), signum(long) 
Package* (4 new methods) 
Readable2* 
ShortvalueOf(short) 
Stringcontains(CharSequence),
- contentEquals(CharSequence),
- format(Locale, String, Object...),
- format(String, Object...),
- replace(CharSequence, CharSequence),
+
Reader* (1 new method) 
Writer* (3 new methods) 
java.langAppendable2* +  
Boolean* (2 new methods) 
Byte* (1 new method) 
Character* (44 new methods)New members of Character.UnicodeBlock are not supported. + All supplementary code points are considered as unassigned. +
Class* (21 new methods) + Enable features "Class.getMethod" and "Class.getDeclaredMethod" for more + uniform support of generics and covariant return types on different platforms3. +
Deprecated* 
DoublevalueOf(double) 
Enum* 
FloatvalueOf(float) 
IllegalArgumentException* (2 new constructors) 
IllegalStateException* (2 new constructors) 
IntegervalueOf(int),
signum(int)
 
Iterable2* 
LongvalueOf(long),
signum(long)
 
Package* (4 new methods) 
Readable2* 
Short* (2 new methods) 
StackTraceElement* (1 new constructor) 
String* (10 new methods and constructors)
isEmpty()4 -
 
StringBuffer - StringBuffer(CharSequence),
- append(CharSequence),
- append(CharSequence, int, int),
- insert(int, CharSequence),
- insert(int, CharSequence, int, int) -
 
StringBuilder - All methods supported in StringBuffer - StringBuilder is replaced with StringBuffer.
SuppressWarnings* 
SystemnanoTime()1,
clearProperty(String)
+  
StringBuffer* (11 new methods and constructors) + Enable feature "StringBuffer.trimToSize" to use an empty implementation of + the StringBuffer.trimToSize() method3. +
StringBuilder*StringBuilder is replaced with StringBuffer.
SuppressWarnings* 
SystemnanoTime()1,
clearProperty(String)
The System.nanoTime() method precision may vary on different platforms. -
ThreadgetStackTrace(),
getId() -
The Thread.getStackTrace() - method returns non-empty stack trace only for the current thread.
- The Thread.getId() method does not reflect the order in which threads are created.
Thread.State* 
ThreadLocalremove()3ThreadLocal and InheritableThreadLocal - are replaced by corresponding classes from the runtime library.3.
TypeNotPresentException* 
java.lang.refSoftReference* +
Thread* (8 new methods) + The Thread.getId() method does not reflect the order in which threads are created.
+ The Thread.getStackTrace() and Thread.getAllStackTraces() + methods return non-empty stack trace only for the current thread.
+ Enable feature "Thread.getState" to support the Thread.getState() method, but it may + be able + to detect only NEW, RUNNABLE and TERMINATED states.3
+ Enable features "Thread.setUncaughtExceptionHandler" and + "Thread.setDefaultUncaughtExceptionHandler" to support exception handlers for threads + created by translated code (in contrast to J2SE 5.0 the default UncaughtExceptionHandler + takes precedence over ThreadGroup)3. +
Thread.State* 
Thread.UncaughtExceptionHandler2* 
ThreadLocal* (1 new method)Enable feature "ThreadLocal.remove" to use alternative ThreadLocal + and InheritableThreadLocal implementations with method + remove()3. +
TypeNotPresentException* 
java.lang.annotation* (all classes)* 
java.lang.instrument** + Bytecode instrumentation is not implemented. +
java.lang.managementManagementFactory + getPlatformMBeanServer() + The ManagementFactory.getPlatformMBeanServer() method simply returns + the first registered MBeanServer or creates it when no one exists. + An implementation of JMX 1.2 must be present in a classpath. +
java.lang.refSoftReference* + Enable feature "SoftReference.NullReferenceQueue" to + support null for the second parameter of SoftReference(Object,ReferenceQueue) - supports null for the second parameter on all platforms3. -
WeakReference* +
WeakReference* + Enable feature "WeakReference.NullReferenceQueue" to + support null for the second parameter of WeakReference(Object,ReferenceQueue) - supports null for the second parameter on all platforms3. -
java.lang.reflectAccessibleObject* 
AnnotatedElement2* 
Constructor* (11 new methods) 
Field* (8 new methods) 
GenericArrayType* 
GenericDeclaration2* 
GenericSignatureFormatError* 
MalformedParameterizedTypeException* 
Method* (14 new methods) 
ParameterizedType* 
Type2* 
TypeVariable* 
WildcardType* 
java.mathBigDecimal - BigDecimal(int),
BigDecimal(long),
ZERO, ONE, TEN,
divideAndRemainder(BigDecimal),
- divideToIntegralValue(BigDecimal),
pow(int),
remainder(BigDecimal),
- toPlainString(),
valueOf(double),
- valueOf(long)
The BigDecimal.setScale(int, int) - method supports negative scales3.
java.netURLopenConnection(Proxy),
- toURI() -
The Proxy is ignored by the openConnection(Proxy) method.
Proxy* 
ProxySelector* 
java.rmi.serverRemoteObjectInvocationHandler* 
java.textDecimalFormatisParseBigDecimal()3,
- setParseBigDecimal(boolean)3
- BigDecimal parsing and formatting precision is limited by - java.lang.Double or java.lang.Long precision. -
java.util.nioCharBuffer - append(CharSequence),
append(CharSequence, int, int),
append(char),
read(CharBuffer)
-
 
java.utilAbstractQueue1* 
Arrays* (21 new methods) 
Collections1* (13 new methods)
- newSetFromMap(Map)4 - -
 
EnumMap* 
EnumSet* 
Formatter* 
LinkedList* (5 new methods) 
PriorityQueue1* 
Queue1,2* 
UUID* 
java.util.regexMatcher - quoteReplacement(String),
toMatchResult()
 
MatchResult2* 
Patternquote(String) 
java.lang.reflectAccessibleObject* (4 new methods) 
AnnotatedElement2* 
Constructor* (11 new methods) 
Field* (8 new methods) 
GenericArrayType* 
GenericDeclaration2* 
GenericSignatureFormatError* 
MalformedParameterizedTypeException* 
Method* (14 new methods) 
ParameterizedType* 
Type2* 
TypeVariable* 
WildcardType* 
java.mathBigDecimal + ZERO, ONE, TEN,
+ BigDecimal(int),
+ BigDecimal(long),
+ BigDecimal(char[]),
+ BigDecimal(char[], int, int),
+ divideAndRemainder(BigDecimal),
+ divideToIntegralValue(BigDecimal),
+ pow(int),
+ remainder(BigDecimal),
+ toPlainString(),
+ valueOf(double),
+ valueOf(long)
+ Enable feature "BigDecimal.setScale" to support negative scales in method + BigDecimal.setScale(int, int)3. +
BigIntegerTEN 
java.netHttpURLConnection* (6 new methods) + Enable features "HttpURLConnection.setChunkedStreamingMode", + "HttpURLConnection.setFixedLengthStreamingMode" + to use the corresponding methods, but on Java 1.4 they will simply return. + Consider using alternative or writing own protocol handlers. +
Proxy* 
ProxySelector* 
URL* (2 new methods)The Proxy is ignored by the + URL.openConnection(Proxy) method. +
URLConnection* (4 new methods) + Enable features "URLConnection.getConnectTimeout", "URLConnection.setConnectTimeout", + "URLConnection.getReadTimeout", "URLConnection.setReadTimeout" + to use the corresponding methods, but on Java 1.4 they will simply return. + Consider using alternative or writing own protocol handlers. +
java.nioCharBuffer* (4 new methods) 
Charset* (1 new method)The Charset.defaultCharset() method returns UTF-8 + if the default charset is unavailable (occurs on JDK 1.4.0). +
java.rmi.serverRemoteObjectInvocationHandler* 
java.textDecimalFormat* (2 new methods) + Enable feature "DecimalFormat.setParseBigDecimal" to support the + DecimalFormat.setParseBigDecimal(boolean) method, but + parsing and formatting precision will still be limited by the java.lang.Double + or java.lang.Long precision3. +
java.utilAbstractQueue1* 
ArrayDeque1,4* 
Arrays* (21 new methods)
+ copyOf(...)4 (10 methods)
+ copyOfRange(...)4 (10 methods) +
 
Collections1* (13 new methods)
+ newSetFromMap(Map)4 +
 
Deque1,2,4* 
EnumMap* 
EnumSet* 
Formatter* 
LinkedList* (5 new methods) 
PriorityQueue1* 
Properties* 
Queue1,2* 
Timer* (3 new methods and constructors) + Enable feature "Timer.All" to use alternative Timer + and TimerTask implementations in order to be able to call Timer(String), + Timer(String, boolean), and Timer.purge()3. +
UUID* 
java.util.concurrent,
java.util.concurrent.atomic,
java.util.concurrent.locks
almost all classes1almost all methodsThe LockSupport class may be unusable due to insufficient performance. + The Condition.awaitNanos(long) method has + + little accuracy guarantees. +
java.util.regexMatcher + quoteReplacement(String),
toMatchResult()
 
MatchResult2* 
Patternquote(String) 
javax.net.sslHttpsURLConnection * (2 new methods) 

1 Supported via the - Backport of JSR 166.
- 2 In most cases this type is being replaced with it's base type.
- 3 Supported only in advanced mode, i.e. when - the advanced option is specified.
- 4 Introduced in Java 6, but available only for 1.4 target.
+ Backport of JSR 166.
+ 2 In most cases this type is replaced with its base type.
+ 3 Supported only when the corresponding feature is enabled via the + support or + advanced options.
+ 4 Introduced in Java 6.

- -

How to write an extension for Retrotranslator?

+

How to write an extension?

- Since most backported classes are discovered by Retrotranslator at translation time, - you may write an extension and simply put it into the Retrotranslator classpath to make it work. - For example, all references to - java.util.EnumSet - are replaced with references to + In order to support API unavailable on the target platform Retrotranslator should be able to replace all references + to new clases, constructors, methods, and fields with references to backports compatible with the platform. + The location of the backports must be specified with the classpath option. The + default + backports for the 1.4 target have been packaged into the retrotranslator-runtime-n.n.n.jar and + backport-util-concurrent-n.n.jar files, and to complement or override them additional backport + names may be specified via the backport option. The backport names may have five + different forms, the first one declares a universal backport package and the others allow to reuse existing backports. +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Backport name formExample
<universal backport package name>net.sf.retrotranslator.runtime
+ com.mycompany.backport
<original package name>:<backport package name>java.util.concurrent:edu.emory.mathcs.backport.java.util.concurrent
+ com.sun.org.apache.xerces.internal:org.apache.xerces
<original class name>:<backport class name>java.lang.StringBuilder:java.lang.StringBuffer
+ java.util.LinkedHashMap:org.apache.commons.collections.map.LinkedMap
<original method name>:<backport method name>java.lang.System.nanoTime:edu.emory.mathcs.backport.java.util.concurrent.helpers.Utils.nanoTime
<original field name>:<backport field name>java.util.Collections.EMPTY_MAP:edu.emory.mathcs.backport.java.util.Collections.EMPTY_MAP
+

+ The names of backport classes in a universal backport package consist of the backport package name, + the name of the original class, and an optional trailing underscore. For example, - net.sf.retrotranslator.runtime.java.util.EnumSet_ (optional trailing underscore) if the latter can be found. - But if you replace a whole class that exists in J2SE 1.4 you may encounter interoperability issues with other libraries. - So, for example, support for Java 5 fields, methods, and constructors of - java.math.BigDecimal is placed into - + net.sf.retrotranslator.runtime.java.util.EnumSet_ is a complete backport of + java.util.EnumSet. + But when classes exist on the target platform then the backports of their new fields, constructors and methods are + grouped into classes with a leading underscore in their names. Look at the - net.sf.retrotranslator.runtime.java.math._BigDecimal (leading underscore): + net.sf.retrotranslator.runtime.java.math._BigDecimal class:

-
    -
  • For a static field there is a public static field with the same name and type.
  • -
  • For a static method there is a public static method with the same signature.
  • -
  • For an instance method there is a public static method with the same signature - but with an additional first parameter representing the instance.
  • -
  • For a constructor there is a public static convertConstructorArguments method that - accepts constructor's arguments an returns an argument for a Java 1.4 constuctor.
  • -
+
    +
  • For a static field there is a public static field with the same name and type.
  • +
  • For a static method there is a public static method with the same signature.
  • +
  • For an instance method there is a public static method with the same signature + but with an additional first parameter representing the instance. +
  • +
  • For a constructor there is a public static convertConstructorArguments method that + accepts constructor's arguments an returns an argument for a Java 1.4 constuctor. +
  • +

- Another approach for constructor backporting is used by - - net.sf.retrotranslator.runtime.java.io._PrintStream. There is a public static + The + net.sf.retrotranslator.runtime.java.io._PrintStream and + + net.sf.retrotranslator.runtime.java.lang._SecurityException classes use another type of + constructor backports. There is a public static createInstanceBuilder method that accepts constructor's arguments an returns an object with public - argument1...argumentN methods and optional public void initialize method. - All argumentX methods provide arguments for a Java 1.4 constuctor and should not have any parameters. - The initialize method has a single parameter for the created instance and may be used for postprocessing. + argument1...argumentN methods and an optional public void initialize method. + All the argumentX methods provide arguments for a Java 1.4 constuctor and should not have any + parameters. The initialize method has a single parameter for the created instance and may be used for + postprocessing. If this approach does not work there is another flexible but not always supported one used by + + net.sf.retrotranslator.runtime.java.lang._StackTraceElement. + If backported methods require access to non-public methods or fields of the instance, they can do it with reflection + when the security manager allows such access. The backports of public instance fields are not supported, but private + instance fields can be emulated using a weak identity map, see + + net.sf.retrotranslator.runtime.java.lang._Thread for an example.

-

- However, if the backported methods require access - to non-public methods or fields of the instance, they cannot be fully handled by Retrotranslator. - While you can use reflection to access any data, translated code generally should not depend on security settings. - For example, it is impossible to write an implementation for methods getSource() - and setSource() of java.beans.PropertyEditorSupport that will work in any environment. - Also this approach cannot be used to replace instance field references. -

-

- You can put your extensions into packages other than net.sf.retrotranslator.runtime. - For example, specify the following at the command line to make Retrotranslator use - com.mycompany.internal.java.lang._String and to rewrite all references to - com.sun.org.apache.xerces.internal.* with org.apache.xerces.*:
- -backport com.mycompany.internal;com.sun.org.apache.xerces.internal:org.apache.xerces -

-

- If you have written an extension that does not contain copyrighted code, you may send - a patch - under the Retrotranslator license. -

What are the limitations?

- -

- Basically, only classes, methods, and fields listed above should work, and other features, - like formatted input, are not supported. Known issues: -

    -
  • Reflection-based tools may be unable to discover additional classes and methods introduced in Java 5 when running on JRE 1.4.
  • -
  • Some applications enable all features only if they detect Java 5, so you may need to override system properties:
    -  java -Djava.version=1.5.0 -Djava.specification.version=1.5 -Djava.class.version=49.0 ...
  • -
  • Translated code running on JRE 5.0 may be incompatible with other Java 5 code when Java 5 API is used.
  • -
  • Reflection on generics and metadata may return incomplete information for dynamically generated classes.
  • -
  • Constants inlined by a compiler and access modifiers are ignored during the verification.
  • -
  • Inherited methods introduced in Java 5 may not work, however upcasting may help in some cases:
    -  ((Writer) new FileWriter("file.tmp")).append("Hello").close();
  • -
  • Serialized objects produced by translated code may be incompatible with JRE 5.0.
  • +
  • Retrotranslator does not emulate the Java 5 memory model.
  • +
  • Only the classes, methods, and fields listed above should work + and the other features, like formatted input, are not supported. +
  • +
  • Java 5 reflection methods should be able to load compiled classes as resources, + so for dynamically generated classes they may return incomplete information. +
  • +
  • The backported implementation of Java 5 API may be incompatible + with the original API implementation when running on J2SE 5.0. +
  • +
  • Reflection-based tools may be unable to discover Java 5 API when running on J2SE 1.4.
  • +
  • The constants inlined by a compiler and access modifiers are ignored during the verification.
-

Alternative tools

    -
  • Retroweaver - - a Java bytecode weaver that enables you to take advantage - of the new 1.5 language features in your source code, - while still retaining compatibility with 1.4 virtual machines.
  • -
  • Declawer - - a customized Java compiler which reduces 1.5 Generics to equivalent 1.4 syntax.
  • +
  • Retroweaver
  • +
  • Declawer
  • +
  • JBossRetro
-

Contact

-

License

-    Retrotranslator: a Java bytecode transformer that translates Java classes
-    compiled with JDK 5.0 into classes that can be run on JVM 1.4.
-
     Copyright (c) 2005 - 2007 Taras Puchko
     All rights reserved.
 
diff --git a/backport/translate.bat b/backport/translate.bat
index 4e2df098c..f6be90e9a 100644
--- a/backport/translate.bat
+++ b/backport/translate.bat
@@ -1,3 +1,3 @@
-java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.4.jar -destjar struts2-core-j4-2.0.4.jar 
-java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-api-2.0.4.jar -destjar struts2-api-j4-2.0.4.jar 
-java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.0.jar -destjar xwork-j4-2.0.0.jar 
+java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/struts2-core-2.1.1-SNAPSHOT.jar -destjar struts2-core-backport-2.1.1-SNAPSHOT.jar 
+java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/struts2-api-2.1.1-SNAPSHOT.jar -destjar struts2-api-backport-2.1.1-SNAPSHOT.jar 
+java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/xwork-2.1.1-SNAPSHOT.jar -destjar xwork-backport-2.1.1-SNAPSHOT.jar 
diff --git a/core/pom.xml b/core/pom.xml
index 4a51d2793..493a34ad9 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-parent
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-core
@@ -57,7 +57,7 @@
                                 
                                     com.opensymphony
                                     xwork
-                                    2.1.0
+                                    2.1.1-SNAPSHOT
                                     sources
                                 
                             
@@ -291,7 +291,7 @@
         
             com.opensymphony
             xwork
-            2.1.0
+            2.1.1-SNAPSHOT
         
 
         
diff --git a/plugins/codebehind/pom.xml b/plugins/codebehind/pom.xml
index 9b4046dda..8d1f6ec4e 100644
--- a/plugins/codebehind/pom.xml
+++ b/plugins/codebehind/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-codebehind-plugin
diff --git a/plugins/config-browser/pom.xml b/plugins/config-browser/pom.xml
index d3047d478..d243c8db1 100644
--- a/plugins/config-browser/pom.xml
+++ b/plugins/config-browser/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-config-browser-plugin
diff --git a/plugins/dojo/pom.xml b/plugins/dojo/pom.xml
index b60faaac3..314c07d95 100644
--- a/plugins/dojo/pom.xml
+++ b/plugins/dojo/pom.xml
@@ -25,7 +25,7 @@
     
         struts2-plugins
         org.apache.struts
-        2.1.0
+        2.1.1-SNAPSHOT
     
     4.0.0
     org.apache.struts
diff --git a/plugins/jasperreports/pom.xml b/plugins/jasperreports/pom.xml
index 5b7eb702d..2d8c11a28 100644
--- a/plugins/jasperreports/pom.xml
+++ b/plugins/jasperreports/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-jasperreports-plugin
diff --git a/plugins/jfreechart/pom.xml b/plugins/jfreechart/pom.xml
index 5470c8070..75b5228fd 100644
--- a/plugins/jfreechart/pom.xml
+++ b/plugins/jfreechart/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
    
     org.apache.struts
     struts2-jfreechart-plugin
diff --git a/plugins/jsf/pom.xml b/plugins/jsf/pom.xml
index f805ece71..92ed8b389 100644
--- a/plugins/jsf/pom.xml
+++ b/plugins/jsf/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-jsf-plugin
diff --git a/plugins/pell-multipart/pom.xml b/plugins/pell-multipart/pom.xml
index 82fea6bbf..59eb0e2f6 100644
--- a/plugins/pell-multipart/pom.xml
+++ b/plugins/pell-multipart/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-pell-multipart-plugin
diff --git a/plugins/plexus/pom.xml b/plugins/plexus/pom.xml
index c28969b5b..192f38505 100644
--- a/plugins/plexus/pom.xml
+++ b/plugins/plexus/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-plexus-plugin
diff --git a/plugins/pom.xml b/plugins/pom.xml
index 7be6cc5cf..35294419f 100644
--- a/plugins/pom.xml
+++ b/plugins/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-parent
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-plugins
diff --git a/plugins/portlet/pom.xml b/plugins/portlet/pom.xml
index d19e52a95..490cd74bb 100644
--- a/plugins/portlet/pom.xml
+++ b/plugins/portlet/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-portlet-plugin
diff --git a/plugins/sitegraph/pom.xml b/plugins/sitegraph/pom.xml
index 2f94c625c..3acca652c 100644
--- a/plugins/sitegraph/pom.xml
+++ b/plugins/sitegraph/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-sitegraph-plugin
diff --git a/plugins/sitemesh/pom.xml b/plugins/sitemesh/pom.xml
index 97c05545a..cba2c906b 100644
--- a/plugins/sitemesh/pom.xml
+++ b/plugins/sitemesh/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-sitemesh-plugin
diff --git a/plugins/spring/pom.xml b/plugins/spring/pom.xml
index 0f6bee843..cbf48a8fb 100644
--- a/plugins/spring/pom.xml
+++ b/plugins/spring/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-spring-plugin
diff --git a/plugins/struts1/pom.xml b/plugins/struts1/pom.xml
index 53a6d2b2e..89bdf6952 100644
--- a/plugins/struts1/pom.xml
+++ b/plugins/struts1/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-struts1-plugin
diff --git a/plugins/tiles/pom.xml b/plugins/tiles/pom.xml
index 318a0c04a..967d38ab6 100644
--- a/plugins/tiles/pom.xml
+++ b/plugins/tiles/pom.xml
@@ -27,7 +27,7 @@
     
         org.apache.struts
         struts2-plugins
-        2.1.0
+        2.1.1-SNAPSHOT
     
     org.apache.struts
     struts2-tiles-plugin
diff --git a/pom.xml b/pom.xml
index d3eac57fc..6773038ee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,7 @@
     4.0.0
     org.apache.struts
     struts2-parent
-    2.1.0
+    2.1.1-SNAPSHOT
     pom
     Struts 2
     http://struts.apache.org/struts2