Search code examples
javatypesparameterized

Rewriting Java 1.5 to 1.4


I need to rewrite Java 1.5 project to java 1.4 (there are some tools that can't swallow 1.5, so a rewrite is necessary).

How should I change these snippets, to compile them under 1.4? Is there a tool for that?

private FooList<Bar> list = new FooList<Bar>(...);

public List<Bar> function(Baz baz) {...}

public Iterator<Bar> iterator() {...}

EDIT: I need to rewrite sources, .jars are irrelevant for my project. I mentioned compiling to express that the rewrite must be correct and acceptable by the compiler.


Solution

  • Use tool to converter tool like Declawer , but basically what it does is run through a directory of Java 1.5 source and output Java 1.4 equivalent source. It doesn't support all 1.5 features.