Ron Resnick wrote:
> 
> Heh.
> 
> You don't get to see internal javac compiler errors every day -
> this was kind of neat:
> 
> [resnick@rresnick f3]$ javac foo.java
> java.lang.NullPointerException
>         at
> sun.tools.tree.ConditionalExpression.costInline(ConditionalExpression.java)
>         at
> sun.tools.tree.BinaryExpression.costInline(BinaryExpression.java)
>         at
> sun.tools.tree.ExpressionStatement.costInline(ExpressionStatement.java)
>         at sun.tools.java.FieldDefinition.cleanup(FieldDefinition.java)
>         at sun.tools.java.ClassDefinition.cleanup(ClassDefinition.java)
>         at sun.tools.javac.Main.compile(Main.java)
>         at sun.tools.javac.Main.main(Main.java)
> error: An exception has occurred in the compiler; please file a bug
> report (http://java.sun.com/cgi-bin/bugreport.cgi).
> 1 error
> [resnick@rresnick f3]$
> 
> I'm posting this to blackdown, rather than reporting it to Sun,
> since I'm not really sure it is a Sun javac problem, and I thought
> the Java/Linux folks might want to see it first.
> If it turns out not to be Linux
> related, my apologies in advance for bringing it up here.
> I encountered this using blackdown jdk117_v1a - maybe someone can
> try this on a non-linux JDK to see if it is reproducible elsewhere?
> I've not tried Jikes, though I'm sure it will compile cleanly with
> Jikes.
> 
> I've isolated the reproducible problem down to one snippet .java file.
> The error dump above came from:
> 
> //File foo.java
> public class foo
> {
>   public void bar(Object param)
>   {
>     if (Object.class == param.getClass()) {// do something}
>   }
> }
> [...]

Your closing } should be placed outside the comment:
{// do something
}

It is a Sun javac problem and not Linux related as it
occurs in the java code of Suns java compiler.
This error also occurs with Solaris/JDK1.1.6 javac.
So you should file a bug report to Sun.

BTW, Jikes compiles this code snippet without errors.
(http://www.alphaWorks.ibm.com/formula/jikes)


Martin Sorgatz
[EMAIL PROTECTED]


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to