[ductilej] push by rc...@opiumtrail.com - Added NullPointerExceptionTest to demonstrate NullPointerExceptions in... on 2010-07-21 02:10 GMT

1 view
Skip to first unread message

duct...@googlecode.com

unread,
Jul 20, 2010, 10:11:05 PM7/20/10
to ductil...@googlegroups.com
Revision: 43eb653fe0
Author: Richard Cook <rc...@opiumtrail.com>
Date: Tue Jul 20 19:07:46 2010
Log: Added NullPointerExceptionTest to demonstrate NullPointerExceptions in
Detyper annotation processor

Compiling this code with Detyper (ant dtests) leads to the uncaught
exceptions with the following stack trace:

[javac] !!! Symbol resolution failed [expr=Foo, sym=symbol not found
error]
[javac] !!! Unable to resolve type [expr=Foo, pkind=2]
[javac] !!! Symbol resolution failed [expr=Foo, sym=symbol not found
error]
[javac] !!! Unable to resolve type [expr=Foo, pkind=2]
[javac] !!! Fatal error
[file=RegularFileObject[/home/rcook/src/ductilej/src/org/ductilej/dtests/NullPointerExceptionTest.java]]
[javac]
[javac]
[javac] An annotation processor threw an uncaught exception.
[javac] Consult the following stack trace for details.
[javac] java.lang.NullPointerException
[javac] at
com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3404)
[javac] at com.sun.tools.javac.code.Types.isSameType(Types.java:575)
[javac] at org.ductilej.detyper.Detype.isConstDecl(Detype.java:1173)
[javac] at org.ductilej.detyper.Detype.visitVarDef(Detype.java:345)
[javac] at
com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:712)
[javac] at
com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
[javac] at
com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)
[javac] at
org.ductilej.util.PathedTreeTranslator.visitBlock(PathedTreeTranslator.java:105)
[javac] at org.ductilej.detyper.Detype.visitBlock(Detype.java:1098)
etc.
http://code.google.com/p/ductilej/source/detail?r=43eb653fe0

Added:
/src/org/ductilej/dtests/NullPointerExceptionTest.java

=======================================
--- /dev/null
+++ /src/org/ductilej/dtests/NullPointerExceptionTest.java Tue Jul 20
19:07:46 2010
@@ -0,0 +1,35 @@
+//
+// $Id$
+
+package org.ductilej.dtests;
+
+/*
+ * Demonstrates an uncaught exception in Detyper.
+ * Compilation with Detyper leads to a call stack like the following:
+ * !!! Symbol resolution failed [expr=Foo, sym=symbol not found error]
+ * !!! Unable to resolve type [expr=Foo, pkind=2]
+ * !!! Symbol resolution failed [expr=Foo, sym=symbol not found error]
+ * !!! Unable to resolve type [expr=Foo, pkind=2]
+ * !!! Fatal error
[file=RegularFileObject[/home/rcook/src/ductilej/src/org/ductilej/dtests/NullPointerExceptionTest.java]]
+ *
+ *
+ * An annotation processor threw an uncaught exception.
+ * Consult the following stack trace for details.
+ * java.lang.NullPointerException
+ * at
com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3404)
+ * at com.sun.tools.javac.code.Types.isSameType(Types.java:575)
+ * at org.ductilej.detyper.Detype.isConstDecl(Detype.java:1173)
+ * at org.ductilej.detyper.Detype.visitVarDef(Detype.java:345)
+ * at
com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:712)
+ * at
com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
+ * at
com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)
+ * at
org.ductilej.util.PathedTreeTranslator.visitBlock(PathedTreeTranslator.java:105)
+ * at org.ductilej.detyper.Detype.visitBlock(Detype.java:1098)
+ */
+public final class NullPointerExceptionTest {
+
+ public NullPointerExceptionTest() {
+ Foo[] foos;
+ }
+}
+

Reply all
Reply to author
Forward
0 new messages