This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Arguments to constructor evaluated in wrong order.
- To: <java at gcc dot gnu dot org>
- Subject: Arguments to constructor evaluated in wrong order.
- From: "Mark J. Roberts" <mjr at statesmean dot com>
- Date: Mon, 28 May 2001 13:09:00 -0400 (EDT)
import java.util.StringTokenizer;
public class Bug {
public static void main(String[] args) {
StringTokenizer s = new StringTokenizer("one two", " ");
Bug b = new Bug(s.nextToken(), s.nextToken());
}
Bug(String one, String two) {
System.out.println("one: "+one);
System.out.println("two: "+two);
}
}
mjr::mjr$ javac Bug.java
mjr::mjr$ java -cp . Bug
one: one
two: two
mjr::mjr$ gcj --main=Bug -o bug Bug.java
mjr::mjr$ ./bug
one: two
two: one
I'm running a build of the 3.0 branch from a couple days ago. Methods
don't have this problem, it's only constructors, afaict.
--
"...it must be held that third-party electronic monitoring, subject
only to the self-restraint of law enforcement officials, has no place
in our society..." Mark Roberts | mjr@statesmean.com