Dag H. Wanvik wrote:
It seems -target jsr14 is not officially supported for the Sun JDK, at least it 
is not
listed in the javac documentation as a valid target:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html#options

True.

From what I can tell -target jsr14 was introduced during generics development in 1.5 beta, and is not officially supported nor documented It still works though, but we probably shouldn't rely on it as it may probably change without notice.

--- snip ---
<5>derby/tests> javac -version
javac 1.5.0_12
...

<5>derby/tests> javac -source 1.5 -target jsr14 SqlStressTest.java
<5>derby/tests>
--- snip ---

This short article on the IBM site is actually a good writeup on this topic by a Suns Brian Goetz:
http://www.ibm.com/developerworks/java/library/j-jtp02277.html

To summarize: -target jsr14 gives you the following on a pre-java 5 JVM:
- generics
- autoboxing
- for-each loops (with some limitations)
- String concatenation using StringBuffer, not StringBuilder

If your interested in more details - please refer to the article. It has some additional information on Retroweaver and Retrotranslator as well.

Thomas
--
Thomas Nielsen

Reply via email to