I moved to a new machine which has the latest Sun's Java compiler and noticed some warnings in the existing Java 6 code. The Eclipse IDE, suggested that I annotate the assignment with:
@SuppressWarnings("rawtypes")
For example:
class Foo<T> {
...
}
...
@SuppressWarnings("rawtypes")
Foo foo = new Foo();
When I moved back to the machine with the older compiler (JDK 1.6.0_20), I have noticed that this older compiler now warns about the suppression of "rawtypes" warnings, claiming that this suppression is unsupported and proposing to replace it with @SuppressWarnings("unchecked"). Also, there were some places which the newest compiler, by default, made me to put both "unchecked" and "rawtypes" - compiling that code with the older compiler reproduces the same warning.
How can I enforce backward/forward compatibility between the two, so that neither compiler produces warnings?