Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
compile directive for conditional compile for Java 1.4 versus Java 5
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="timjowers, post: 2955487"] FWIW, I decided on the exploit of compiler optimization. The technique is to create unreachable code with as if(false) and put your Java 5 code there. Make that block reachable to compile in Java 5. E.g. boolean JAVA_5_PLUS = false; // Java by design lacks conditional compilation so various workarounds // are to comment out code, use a custom preprocessor (see Munge from the Swing team), // or use if( false ) or such blocks (which are normally not compiled due to optimizing them out.) if( JAVA_5_PLUS ) start = System.nanoTime(); else start = System.currentTimeMillis(); TimJowers [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
compile directive for conditional compile for Java 1.4 versus Java 5
Top