typetools / checker-framework-inference

Inference of pluggable types for Java
10 stars 33 forks source link

Add minimized failing tests #16

Closed Jianchu closed 8 years ago

Jianchu commented 8 years ago

Inference will crush for this testcase. NullPointerException is thrown.

Jianchu commented 8 years ago

WildcardsProblem.java will cause inference crash, and the following message is shown:

INFO: error: Missing VarAnnot annotation: ? extends @VarAnnot(6) Object
  Compilation unit: issues/WildcardsProblem.java
  Exception: java.lang.Throwable; Stack trace: org.checkerframework.framework.source.SourceChecker.errorAbort(SourceChecker.java:667)
  org.checkerframework.javacutil.ErrorReporter.errorAbort(ErrorReporter.java:28)
  checkers.inference.DefaultSlotManager.getVariableSlot(DefaultSlotManager.java:173)
  checkers.inference.InferenceTypeVariableSubstitutor.substituteTypeVariable(InferenceTypeVariableSubstitutor.java:72)
  org.checkerframework.framework.type.TypeVariableSubstitutor$Visitor.visitTypeVariable(TypeVariableSubstitutor.java:126)
  org.checkerframework.framework.type.TypeVariableSubstitutor$Visitor.visitTypeVariable(TypeVariableSubstitutor.java:59)
  org.checkerframework.framework.type.AnnotatedTypeMirror$AnnotatedTypeVariable.accept(AnnotatedTypeMirror.java:1482)
  org.checkerframework.framework.type.AnnotatedTypeCopier.visit(AnnotatedTypeCopier.java:82)
  org.checkerframework.framework.type.TypeVariableSubstitutor.substitute(TypeVariableSubstitutor.java:32)
  org.checkerframework.framework.util.AnnotatedTypes.subst(AnnotatedTypes.java:487)
  org.checkerframework.framework.util.AnnotatedTypes.asMemberOfImpl(AnnotatedTypes.java:462)
  org.checkerframework.framework.util.AnnotatedTypes.asMemberOf(AnnotatedTypes.java:375)
  org.checkerframework.framework.type.TypeFromExpressionVisitor.visitMemberSelect(TypeFromExpressionVisitor.java:207)
  org.checkerframework.framework.type.TypeFromExpressionVisitor.visitMemberSelect(TypeFromExpressionVisitor.java:52)
  com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1903)
  com.sun.source.util.SimpleTreeVisitor.visit(SimpleTreeVisitor.java:53)
  org.checkerframework.framework.type.TypeFromTree.fromExpression(TypeFromTree.java:36)
  org.checkerframework.framework.type.AnnotatedTypeFactory.fromExpression(AnnotatedTypeFactory.java:1056)
  org.checkerframework.framework.type.AnnotatedTypeFactory.getAnnotatedType(AnnotatedTypeFactory.java:872)
  org.checkerframework.framework.flow.CFAbstractTransfer.getValueFromFactory(CFAbstractTransfer.java:172)
  org.checkerframework.framework.flow.CFAbstractTransfer.visitFieldAccess(CFAbstractTransfer.java:540)
  org.checkerframework.framework.flow.CFAbstractTransfer.visitFieldAccess(CFAbstractTransfer.java:96)
  org.checkerframework.dataflow.cfg.node.FieldAccessNode.accept(FieldAccessNode.java:79)
  org.checkerframework.dataflow.analysis.Analysis.callTransferFunction(Analysis.java:362)
  org.checkerframework.dataflow.analysis.Analysis.performAnalysis(Analysis.java:220)
  org.checkerframework.framework.type.GenericAnnotatedTypeFactory.analyze(GenericAnnotatedTypeFactory.java:778)
  org.checkerframework.framework.type.GenericAnnotatedTypeFactory.analyze(GenericAnnotatedTypeFactory.java:749)
  org.checkerframework.framework.type.GenericAnnotatedTypeFactory.performFlowAnalysis(GenericAnnotatedTypeFactory.java:695)
  checkers.inference.InferenceAnnotatedTypeFactory.performFlowAnalysis(InferenceAnnotatedTypeFactory.java:470)
  org.checkerframework.framework.type.GenericAnnotatedTypeFactory.checkAndPerformFlowAnalysis(GenericAnnotatedTypeFactory.java:948)
  checkers.inference.InferenceAnnotatedTypeFactory.annotateImplicit(InferenceAnnotatedTypeFactory.java:505)
  org.checkerframework.framework.type.GenericAnnotatedTypeFactory.annotateImplicit(GenericAnnotatedTypeFactory.java:899)
  org.checkerframework.framework.type.AnnotatedTypeFactory.getAnnotatedType(AnnotatedTypeFactory.java:879)
  org.checkerframework.framework.type.AnnotatedTypeFactory.getAnnotatedType(AnnotatedTypeFactory.java:1967)
  org.checkerframework.common.basetype.BaseTypeVisitor.visitClass(BaseTypeVisitor.java:296)
  org.checkerframework.common.basetype.BaseTypeVisitor.visitClass(BaseTypeVisitor.java:173)
  com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:720)
  com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:50)
  org.checkerframework.framework.source.SourceVisitor.visit(SourceVisitor.java:70)
  org.checkerframework.framework.source.SourceChecker.typeProcess(SourceChecker.java:887)
  org.checkerframework.common.basetype.BaseTypeChecker.typeProcess(BaseTypeChecker.java:450)
  org.checkerframework.javacutil.AbstractTypeProcessor$AttributionTaskListener.finished(AbstractTypeProcessor.java:205)
  com.sun.tools.javac.api.ClientCodeWrapper$WrappedTaskListener.finished(ClientCodeWrapper.java:681)
  com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:111)
  com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1342)
  com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1296)
  com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:901)
  com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:860)
  com.sun.tools.javac.main.Main.compile(Main.java:523)
  com.sun.tools.javac.main.Main.compile(Main.java:381)
  com.sun.tools.javac.main.Main.compile(Main.java:370)
  com.sun.tools.javac.main.Main.compile(Main.java:361)
  checkers.inference.CheckerFrameworkUtil.invokeCheckerFramework(CheckerFrameworkUtil.java:12)
  checkers.inference.InferenceMain.startCheckerFramework(InferenceMain.java:183)
  checkers.inference.InferenceMain.run(InferenceMain.java:145)
  checkers.inference.InferenceMain.main(InferenceMain.java:117)

And it will run successfully in hacks mode.