bug in bytecode compiler 3.3?
Erik Poupaert
erik.poupaert@chello.be
Fri Feb 21 11:02:00 GMT 2003
The following code compiles (with option -C) properly to bytecode in 3.2,
but doesn't in 3.3 (on minGW):
--------------------------------------------cut-here------------------------
---------------
package mytest;
public class MyTest
{
String errorMsg;
public void fatalError(ExceptionX e)
{
errorMsg = e.toString ();
}
}
class ExceptionX extends Exception {}
--------------------------------------------cut-here------------------------
---------------
[javac] C:\devroot\tst\lib-xmlrpc-test\src\mytest/mytest.java:3: error:
Class `mytest.MyTest' already defined in C:\
devroot\tst\lib-xmlrpc-test\src\mytest\MyTest.java:3.
[javac] C:\devroot\tst\lib-xmlrpc-test\src\mytest/mytest.java:12: error:
Class `mytest.ExceptionX' already defined i
n C:\devroot\tst\lib-xmlrpc-test\src\mytest\MyTest.java:12.
The problem only occurs when the file is placed in the folder "mytest",
which has the same name as the class itself and the package, ignoring case.
If it is placed in a differently named folder, the bug disappears.
Since this kind of naming situation occurs quite frequently, it affects
quite a bit of code.
More information about the Java
mailing list