JBuilder2005 upgrade to the realization of the Reconstruction JDK5.0 (1)
JDK 5.0 grammatical do a lot of major improvements, although low in the development of the JDK versions of the source code, can do almost any changes can be directly running on JDK 5.0. But there is still the need for the upgrade version of Reconstruction, and that can be used for JDK 5.0 and while cycle, automatically loaded / uncrating, generic functions, such as improved, in the more compact code, the code to optimize performance. So JBuilder specifically for low JDK 5.0 version upgrade to the procedure provided three Reconstruction-friendly features you achieve seamless upgrade.
1, works based on JDK 5.0
Although JDK 5.0 support JBuilder 2005, but its default JDK version 1.4.2, for projects JDK version 5.0, you must install JDK 5.0, and JBuilder under the corresponding settings. JDK 5.0 on the detailed settings we are not too much description, in a nutshell, it includes the following steps:
1) Installation of JDK 5.0 (from http://java.sun.com/j2se/1.5.0/download.jsp download).
2) Tools-> Configure-> JDKs … GM designated JDK5.0 installed JDK installation path.
3) Project-> Project Properties …-> in Paths set the page will be set up for JDK 5.0 JDK.
4) Project-> Project Properties …-> Build-> set the page in Java, Language features: Setting up for the Java 2 SDK, V 5.0 (generics enabled), Target VM set to the Java 2 SDK, v 5.0 and later .
Only JDK version of the project will be set up for JDK 5.0, we can carry out the reconstruction JDK 5.0 code.
2, optimization cycle
JDK 5.0 introduced a more efficient cycle, as the pattern of JDK 5.0 cycle, including:
Ergodic array
List Traversal
Iterator for loop
Iterator while the cycle
JBuilder will provide low JDK versions of the corresponding code conversion cycle this cycle JDK5.0 style reconstruction, we have adopted an array of remodeling this traversal do that, please see the following low-cycle version JDK code:
Version of the code lists 11 low cycle style
1. Public static void arrayLoopRefactoring ()
2. (
3. MyArray int [] = (1, 2, 3, 4);
4. For (int x = 0; x <myArray.length; x + +) (
5. System.out.println (myArray [x]);
6.)
7.)
The cursor will be moved to the fourth line for (int x = 0; x <myArray.length; x + +) Intermediate: Ctrl + Shift + R-> Introduce Foreach out of circulation Reconstruction dialog:







