Java 1.3.1 code compiled with Java 1.4.1 compiler fails.
Compiling some Java 1.3.1 code with the 1.4.1 version of javac causes a java.lang.NoSuchMethodError when it is run. Java 1.4.1 adds an append(StringBuffer) method to the StringBuffer class. If you have code that calls append with a StringBuffer as an argument, the Java 1.3.1 version of javac compiles this to append(Object). The Java 1.4.1 version of javac compiles the same code to append(StringBuffer). Running the version compiled with the Java 1.4.1 version of javac in a Java 1.3.1 environment returns a java.lang.NoSuchMethodError.
To get your code to run on Java 1.3.1, just cast your argument to java.lang.Object. For example, append((Object) stringBufArg)
Last updated: 2003-06-11