Strange Annotation related compilation problem in xith-tk

I had a really strange compilation problem after updating my xith-tk from cvs:


An exception has occurred in the compiler (1.5.0_08). Please file a bug at the Java Developer Connection
(http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates.
Include your program and the following diagnostic in your report.  Thank you.
java.lang.AssertionError: {unused}
	at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.visitArray(TreeMaker.java:634)
	at com.sun.tools.javac.code.Attribute$Array.accept(Attribute.java:124)
	at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.translate(TreeMaker.java:637)
	at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.visitCompoundInternal(TreeMaker.java:628)
	at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.translate(TreeMaker.java:641)
	at com.sun.tools.javac.tree.TreeMaker.Annotation(TreeMaker.java:649)
	at com.sun.tools.javac.tree.TreeMaker.Annotations(TreeMaker.java:570)
	at com.sun.tools.javac.tree.TreeMaker.VarDef(TreeMaker.java:554)
	at com.sun.tools.javac.comp.Lower.visitArrayForeachLoop(Lower.java:2808)
	at com.sun.tools.javac.comp.Lower.visitForeachLoop(Lower.java:2757)
	at com.sun.tools.javac.tree.Tree$ForeachLoop.accept(Tree.java:597)
	at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
	at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:54)
	at com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:145)
	at com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:2927)
	at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:535)
	at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
	at com.sun.tools.javac.comp.Lower.visitIf(Lower.java:2382)
	at com.sun.tools.javac.tree.Tree$If.accept(Tree.java:715)
	at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
	at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:54)
	at com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:145)
	at com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:2927)
	at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:535)
	at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
	at com.sun.tools.javac.tree.TreeTranslator.visitMethodDef(TreeTranslator.java:129)
	at com.sun.tools.javac.comp.Lower.visitMethodDefInternal(Lower.java:2267)
	at com.sun.tools.javac.comp.Lower.visitMethodDef(Lower.java:2186)
	at com.sun.tools.javac.tree.Tree$MethodDef.accept(Tree.java:478)
	at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
	at com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:1989)
	at com.sun.tools.javac.tree.Tree$ClassDef.accept(Tree.java:434)
	at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
	at com.sun.tools.javac.comp.Lower.translate(Lower.java:1901)
	at com.sun.tools.javac.comp.Lower.translateTopLevelClass(Lower.java:3064)
	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:487)
	at com.sun.tools.javac.main.Main.compile(Main.java:592)
	at com.sun.tools.javac.main.Main.compile(Main.java:544)
	at com.sun.tools.javac.Main.compile(Main.java:67)
	at com.sun.tools.javac.Main.main(Main.java:52)

luckily I found this equivalent problem. It seems to be a known compiler bug fixed in mustang and was caused by an improper placed Annotation in DaeExporter line 1244:


         for ( @SuppressWarnings("unused")
		final TransformNode  viewNode : viewNodes )

it is stated in th the bug report, that @SuppressWarnings is not allowed inside a statement (the for-loop), but the compiler should not crash this way.

So THAT was a tough one :o. It’s really great if your compiler is so helpful :-
I hope this helps someone with the same problem…

Have you guys ever encountered this or are you using mustang?

Got the same problem here, Thanks for the help

That is the same as this bug:
http://www.java-gaming.org/forums/index.php?topic=14948.0

I’ll delete the offending code today.

That bug has been there for 2 months. Odd that you and I would discover it at about the same time.

I already changed the offending code in xith-tk and committed it.