[Checkers] Interned checker throws ClassCastException
Michael Ernst
mernst at csail.mit.edu
Fri Feb 29 15:44:07 EST 2008
Matt told me that he believes the current version of the Interned checker
(in SVN) should at least not throw any exceptions, even if it doesn't
perfectly enforce all the rules at the moment. But this wasn't my
experience: I get a ClassCastException when I run "make interned-all" in
Daikon. See below.
-Mike
-*- mode: compilation; default-directory: "~/research/invariants/java/" -*-
Compilation started at Fri Feb 29 21:41:36
make interned-all
/DS/home-0/mernst/research/invariants/scripts/javac-xlint -p ([/\\]jtb[/\\])|([/\\]junit[/\\]) javac -g -target 5 -typeprocessor checkers.interned.InternedChecker ...
./daikon/PptName.java:243: warning: use of .equals can be safely replaced by ==/!=
return FileIO.object_suffix.equals(point);
^
./daikon/PptName.java:251: warning: use of .equals can be safely replaced by ==/!=
return FileIO.class_static_suffix.equals(point);
^
./daikon/PptName.java:258: warning: use of .equals can be safely replaced by ==/!=
return FileIO.global_suffix.equals (point);
^
./daikon/PptName.java:280: warning: use of .equals can be safely replaced by ==/!=
return (point != null) && point.equals(FileIO.exit_suffix);
^
./daikon/inv/Invariant.java:904: comparison requires two @Interned types
if (inv1 == inv2)
^
./daikon/inv/Invariant.java:933: comparison requires two @Interned types
if (inv1.ppt.parent == inv2.ppt.parent) {
^
./daikon/inv/Invariant.java:1017: warning: use of .equals can be safely replaced by ==/!=
if (!inv1.getClass().equals(inv2.getClass())) {
^
./daikon/inv/Invariant.java:1036: warning: use of .equals can be safely replaced by ==/!=
if (!var1.name().equals (var2.name()))
^
./daikon/inv/Invariant.java:1261: incompatible types.
found : daikon.VarInfo[@checkers.quals.Interned ]
required: java.lang.Object[]
if (! ArraysMDE.noDuplicates(vis)) {
^
./daikon/inv/Invariant.java:1283: incompatible types.
found : daikon.VarInfo[@checkers.quals.Interned ]
required: java.lang.Object[]
return ! ArraysMDE.noDuplicates(ppt.var_infos);
^
./daikon/inv/Invariant.java:1408: warning: use of .equals can be safely replaced by ==/!=
if (inv1.getClass().equals(inv2.getClass())) {
^
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.ClassCastException: checkers.types.AnnotatedTypeMirror$AnnotatedDeclaredType cannot be cast to checkers.types.AnnotatedTypeMirror$AnnotatedExecutableType
at checkers.basetype.BaseTypeVisitor.visitMethodInvocation(BaseTypeVisitor.java:171)
at checkers.interned.InternedVisitor.visitMethodInvocation(InternedVisitor.java:91)
at checkers.interned.InternedVisitor.visitMethodInvocation(InternedVisitor.java:28)
at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1315)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
at com.sun.source.util.TreeScanner.visitExpressionStatement(TreeScanner.java:239)
at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1155)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90)
at com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:159)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:781)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80)
at com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:143)
at checkers.basetype.BaseTypeVisitor.visitMethod(BaseTypeVisitor.java:137)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:681)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:98)
at com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:132)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:604)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:98)
at com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:119)
at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:488)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
at checkers.source.SourceChecker.process(SourceChecker.java:194)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:733)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:662)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:807)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:995)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:741)
at com.sun.tools.javac.main.Main.compile(Main.java:380)
at com.sun.tools.javac.main.Main.compile(Main.java:306)
at com.sun.tools.javac.main.Main.compile(Main.java:297)
at com.sun.tools.javac.Main.compile(Main.java:82)
at com.sun.tools.javac.Main.main(Main.java:67)
make: *** [interned-all] Error 1
Compilation exited abnormally with code 2 at Fri Feb 29 21:41:54
More information about the checkers
mailing list