When I compile the source file TIN.java, in the directory /home/ayw/public_html/classes,
using the 1.0 Pre-Beta javac, I get:
javac: An exception has occurred in the compiler, please file a bug report.
I also get the puzzling message:
/home/ayw/public_html/classes/TIN.java:1: Class TIN already defined in TIN.java.
Oddly, if I copy the source file to another directory (or if I rename it TIM.java and change
occurences of TIN within it to TIM), the compiler no longer reports an exception., and the
message "Class TIN already defined in TIN.java" no longer appears.
A slight change in the source results in a different error:
java.tools.java.InternalError codeConversion: 10, 13
Here are the details :
poprad% cat TIN.java
class TIN {
int n;
T loop;
void run() {
if (loop.n > 1)
n = 0;
}
}
poprad% pwd
/home/ayw/public_html/classes
poprad% which javac
/home/ayw/sources/hotjava/bin/javac
poprad% javac TIN.java
java.lang.NullPointerException
at java.tools.tree.FieldExpression.codeLValue(FieldExpression.java)
at java.tools.tree.FieldExpression.codeValue(FieldExpression.java)
at java.tools.tree.GreaterExpression.codeBranch(GreaterExpression.java)
at java.tools.tree.IfStatement.code(IfStatement.java)
at java.tools.javac.SourceField.code(SourceField.java)
at java.tools.javac.SourceField.code(SourceField.java)
at java.tools.javac.SourceClass.compileClass(SourceClass.java)
at java.tools.javac.SourceClass.compile(SourceClass.java)
at java.tools.javac.Main.compile(Main.java)
at java.tools.javac.Main.main(Main.java)
javac: An exception has occurred in the compiler, please file a bug report.
/home/ayw/public_html/classes/TIN.java:1: Class TIN already defined in TIN.java.
class TIN {
^
/home/ayw/public_html/classes/TIN.java:3: Class T not found in type declaration.
T loop;
^
/home/ayw/public_html/classes/TIN.java:5: Class T not found in void run().
if (loop.n > 1)
^
poprad% mkdir anotherdir
poprad% cp -p TIN.java anotherdir
poprad% cd anotherdir
/home/ayw/public_html/classes/anotherdir
poprad% javac TIN.java
TIN.java:3: Class T not found in type declaration.
T loop;
^
TIN.java:5: Class T not found in void run().
if (loop.n > 1)
^
2 errors
poprad% cd ..
/home/ayw/public_html/classes
poprad% sed 's/loop.n/loop/' < TIN.java >! tmp; mv tmp TIN.java; cat TIN.java
mv: overwrite TIN.java (y/n)? y
class TIN {
int n;
T loop;
void run() {
if (loop > 1)
n = 0;
}
}
poprad% javac TIN.java
java.tools.java.InternalError codeConversion: 10, 13
at java.lang.Exception.<init>(Exception.java)
at java.tools.java.InternalError.<init>(InternalError.java)
at java.tools.tree.Expression.codeConversion(Expression.java)
at java.tools.tree.ConvertExpression.codeValue(ConvertExpression.java)
at java.tools.tree.GreaterExpression.codeBranch(GreaterExpression.java)
at java.tools.tree.IfStatement.code(IfStatement.java)
at java.tools.javac.SourceField.code(SourceField.java)
at java.tools.javac.SourceField.code(SourceField.java)
at java.tools.javac.SourceClass.compileClass(SourceClass.java)
at java.tools.javac.SourceClass.compile(SourceClass.java)
/home/ayw/public_html/classes/TIN.java:0: class TIN:void run()@java.tools.java.InternalError: codeConversion: 10, 13
class TIN {
^
/home/ayw/public_html/classes/TIN.java:1: Class TIN already defined in TIN.java.
class TIN {
^
/home/ayw/public_html/classes/TIN.java:3: Class T not found in type declaration.
T loop;
^
/home/ayw/public_html/classes/TIN.java:5: Incompatible type for >. Can't convert T to int.
if (loop > 1)
^
4 errors
poprad% rm anotherdir/*
poprad% cp -p TIN.java anotherdir
poprad% cd anotherdir
/home/ayw/public_html/classes/anotherdir
poprad% javac TIN.java
TIN.java:3: Class T not found in type declaration.
T loop;
^
TIN.java:5: Incompatible type for >. Can't convert T to int.
if (loop > 1)
^
2 errors
using the 1.0 Pre-Beta javac, I get:
javac: An exception has occurred in the compiler, please file a bug report.
I also get the puzzling message:
/home/ayw/public_html/classes/TIN.java:1: Class TIN already defined in TIN.java.
Oddly, if I copy the source file to another directory (or if I rename it TIM.java and change
occurences of TIN within it to TIM), the compiler no longer reports an exception., and the
message "Class TIN already defined in TIN.java" no longer appears.
A slight change in the source results in a different error:
java.tools.java.InternalError codeConversion: 10, 13
Here are the details :
poprad% cat TIN.java
class TIN {
int n;
T loop;
void run() {
if (loop.n > 1)
n = 0;
}
}
poprad% pwd
/home/ayw/public_html/classes
poprad% which javac
/home/ayw/sources/hotjava/bin/javac
poprad% javac TIN.java
java.lang.NullPointerException
at java.tools.tree.FieldExpression.codeLValue(FieldExpression.java)
at java.tools.tree.FieldExpression.codeValue(FieldExpression.java)
at java.tools.tree.GreaterExpression.codeBranch(GreaterExpression.java)
at java.tools.tree.IfStatement.code(IfStatement.java)
at java.tools.javac.SourceField.code(SourceField.java)
at java.tools.javac.SourceField.code(SourceField.java)
at java.tools.javac.SourceClass.compileClass(SourceClass.java)
at java.tools.javac.SourceClass.compile(SourceClass.java)
at java.tools.javac.Main.compile(Main.java)
at java.tools.javac.Main.main(Main.java)
javac: An exception has occurred in the compiler, please file a bug report.
/home/ayw/public_html/classes/TIN.java:1: Class TIN already defined in TIN.java.
class TIN {
^
/home/ayw/public_html/classes/TIN.java:3: Class T not found in type declaration.
T loop;
^
/home/ayw/public_html/classes/TIN.java:5: Class T not found in void run().
if (loop.n > 1)
^
poprad% mkdir anotherdir
poprad% cp -p TIN.java anotherdir
poprad% cd anotherdir
/home/ayw/public_html/classes/anotherdir
poprad% javac TIN.java
TIN.java:3: Class T not found in type declaration.
T loop;
^
TIN.java:5: Class T not found in void run().
if (loop.n > 1)
^
2 errors
poprad% cd ..
/home/ayw/public_html/classes
poprad% sed 's/loop.n/loop/' < TIN.java >! tmp; mv tmp TIN.java; cat TIN.java
mv: overwrite TIN.java (y/n)? y
class TIN {
int n;
T loop;
void run() {
if (loop > 1)
n = 0;
}
}
poprad% javac TIN.java
java.tools.java.InternalError codeConversion: 10, 13
at java.lang.Exception.<init>(Exception.java)
at java.tools.java.InternalError.<init>(InternalError.java)
at java.tools.tree.Expression.codeConversion(Expression.java)
at java.tools.tree.ConvertExpression.codeValue(ConvertExpression.java)
at java.tools.tree.GreaterExpression.codeBranch(GreaterExpression.java)
at java.tools.tree.IfStatement.code(IfStatement.java)
at java.tools.javac.SourceField.code(SourceField.java)
at java.tools.javac.SourceField.code(SourceField.java)
at java.tools.javac.SourceClass.compileClass(SourceClass.java)
at java.tools.javac.SourceClass.compile(SourceClass.java)
/home/ayw/public_html/classes/TIN.java:0: class TIN:void run()@java.tools.java.InternalError: codeConversion: 10, 13
class TIN {
^
/home/ayw/public_html/classes/TIN.java:1: Class TIN already defined in TIN.java.
class TIN {
^
/home/ayw/public_html/classes/TIN.java:3: Class T not found in type declaration.
T loop;
^
/home/ayw/public_html/classes/TIN.java:5: Incompatible type for >. Can't convert T to int.
if (loop > 1)
^
4 errors
poprad% rm anotherdir/*
poprad% cp -p TIN.java anotherdir
poprad% cd anotherdir
/home/ayw/public_html/classes/anotherdir
poprad% javac TIN.java
TIN.java:3: Class T not found in type declaration.
T loop;
^
TIN.java:5: Incompatible type for >. Can't convert T to int.
if (loop > 1)
^
2 errors