Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Java Engine

Radar #3165467

Java 1.3.1 code compiled with Java 1.4.1 compiler fails.

Description:

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.

Resolution:

To get your code to run on Java 1.3.1, just cast your argument to java.lang.Object. For example, append((Object) stringBufArg)



< Previous PageNext Page > Hide TOC


Last updated: 2003-06-11




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice