A very short test case, derived from Modena test ciner093, causes
javac to abort.
algol% cat X.java
class X{
final int i;
int func() throws Exception { throw new Exception();}
{
try{ i = func(); }
catch (Exception e) { i = 4; }
}
public static void main(String[] arg) {
X ox = new X();
}
}
algol% /set/sqe/java/anat/sparc-S2/jdk1.1.4/bin/javac -d . X.java
sun.tools.java.CompilerError: copyInline
at sun.tools.tree.TryStatement.copyInline(TryStatement.java)
at sun.tools.tree.CompoundStatement.copyInline(CompoundStatement.java)
at sun.tools.tree.InlineMethodExpression.copyInline(InlineMethodExpression.java)
at sun.tools.tree.MethodExpression.makeVarInits(MethodExpression.java)
at sun.tools.tree.MethodExpression.checkValue(MethodExpression.java)
at sun.tools.tree.MethodExpression.check(MethodExpression.java)
at sun.tools.tree.ExpressionStatement.check(ExpressionStatement.java)
at sun.tools.tree.Statement.checkBlockStatement(Statement.java)
at sun.tools.tree.CompoundStatement.check(CompoundStatement.java)
at sun.tools.tree.Statement.checkMethod(Statement.java)
at sun.tools.javac.SourceField.check(SourceField.java)
at sun.tools.javac.SourceClass.checkFields(SourceClass.java)
at sun.tools.javac.SourceClass.checkInternal(SourceClass.java)
at sun.tools.javac.SourceClass.check(SourceClass.java)
at sun.tools.javac.Main.compile(Main.java)
at sun.tools.javac.Main.main(Main.java)
error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error
javac to abort.
algol% cat X.java
class X{
final int i;
int func() throws Exception { throw new Exception();}
{
try{ i = func(); }
catch (Exception e) { i = 4; }
}
public static void main(String[] arg) {
X ox = new X();
}
}
algol% /set/sqe/java/anat/sparc-S2/jdk1.1.4/bin/javac -d . X.java
sun.tools.java.CompilerError: copyInline
at sun.tools.tree.TryStatement.copyInline(TryStatement.java)
at sun.tools.tree.CompoundStatement.copyInline(CompoundStatement.java)
at sun.tools.tree.InlineMethodExpression.copyInline(InlineMethodExpression.java)
at sun.tools.tree.MethodExpression.makeVarInits(MethodExpression.java)
at sun.tools.tree.MethodExpression.checkValue(MethodExpression.java)
at sun.tools.tree.MethodExpression.check(MethodExpression.java)
at sun.tools.tree.ExpressionStatement.check(ExpressionStatement.java)
at sun.tools.tree.Statement.checkBlockStatement(Statement.java)
at sun.tools.tree.CompoundStatement.check(CompoundStatement.java)
at sun.tools.tree.Statement.checkMethod(Statement.java)
at sun.tools.javac.SourceField.check(SourceField.java)
at sun.tools.javac.SourceClass.checkFields(SourceClass.java)
at sun.tools.javac.SourceClass.checkInternal(SourceClass.java)
at sun.tools.javac.SourceClass.check(SourceClass.java)
at sun.tools.javac.Main.compile(Main.java)
at sun.tools.javac.Main.main(Main.java)
error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error
- duplicates
-
JDK-4038527 Try-catch in instance initializer causes compiler error.
-
- Closed
-