Strategies for migrating a medium-sized code base from Java 1.4.2 to Java 5

I look through the code base (~ 20K LOC) and try to determine how to transfer it from 1.4.2 to 5. Obviously, this is not a night project and the suggestion I received is to write new code against Java 5 and transfer the old code to the doll . In addition, I am not an expert in the new Java 5 features (i.e., I know them, but I never wrote for production use).

My questions:

  • What Java 5 features are commonly used in production code? (i.e. generics, auto-boxing, etc.) Are there any features that should be avoided / not considered best practices?

  • What are the best refactoring strategies I can use to migrate a database of this size? (i.e., make changes to the classes one at a time only when the class is edited, etc.) The goal is to reduce the risk based on the code. The limitation is resources for refactoring.

Any advice is appreciated - thanks in advance.

UPDATE - the year is too late, but better late than never? =)

Thanks for all the comments - many great points of view. In the life of a software developer, there will always be projects that you are trying to complete, but you will never get around because of something more “urgent”.

Regarding the use of Java 5 (at the time), this was what was required in the client work environment, so we did not use Java 6.

, , - , , , , . , , . ; , , , , .

, , .

+3
6

Java 5 Java 4. , , , - enum Java 4.

:

http://java.sun.com/j2se/1.5.0/compatibility.html

, , JAXP. xerces.jar .

, , - . , , , . , - .

, , , - @Override. .

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Override.html

concurrency , . , ThreadPoolExecutor.

http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#concurrency

. , , Java 5, .

+6

"" ; , , . , , , "". .

+2

, , .

, , Java, Java 6, Java 5. Java 6 . Java 5 (imho).

-, , , - . . , , , .

- Java 6 , . , . .

, , , , , / , . Java 1.4.2. , .

, , , / API .

, . Axis1 to Axis2 . .

, ... . , .

, : ~ 20K LOC. (, 3 ).

, , , . unit test , . . , .

, , , , . .

+2

, 1.4 5 ( , ), .

, :

? , , .

, ? , , , API (, ..).

, Java 5. . autoboxing , ( ). . , . , - .

+1

20 ( ) kloc , . , , Java SE 5. , ( - - Iterator<char[]> iter; ... System.out.println(iter.next()); ).

. , Map . TreeMap - Java, ( Comparator<T> Comparable<T>).

, , . , .

+1

, . Java 1.5, , 1.5, 1.4.2, 1.5.

, , . , , , 1.5 . 10 , , - - -.

1.5, - , , . , .

+1

Source: https://habr.com/ru/post/1706036/


All Articles