Buggy code:
@ SupportedOptions ( { "warn" , "infer" } ) public abstract class InferenceChecker extends BaseTypeChecker { public static boolean DEBUG = false ; public static final String CALLSITE_PREFIX = "CALLSITE-" ; public static final String FAKE_PREFIX = "FAKE-" ; public static final String LIB_PREFIX = "LIB-" ; public static final String THIS_SUFFIX = "-THIS" ; public static final String RETURN_SUFFIX = "-RETURN" ; public static final String ARRAY_SUFFIX = "[]" ; private boolean isInferring = false ; protected Enter enter ; protected SourcePositions positions ; private Comparator < AnnotationMirror > comparator ; private Types types ; protected static Map < String , Reference > annotatedReferences = new HashMap < String , Reference > ( ) ; protected static Map < String , List < Conversion > > convertedReferences = new HashMap < > ( ) ; protected static Map < String , ExecutableReference > allocationReferences = new HashMap < > ( ) ; protected static Set < String > needCopyMethods = new HashSet < > ( ) ; private Set < Constraint > constraints = new LinkedHashSet < Constraint > ( ) ; protected AnnotatedTypeFactory currentFactory ; private Set < TypeElement > visitedClasses = new HashSet < TypeElement > ( ) ; private CompilationUnitTree currentNewRoot ; @ Override public void initChecker ( ProcessingEnvironment processingEnv ) { } public Map < String , List < Conversion > > getConvertedReferences ( ) { } public Set < String > getNeedCopyMethods ( ) { } public SourcePositions getPositions ( ) { } @ Override public AnnotatedTypeFactory createFactory ( CompilationUnitTree root ) { } @ Override protected SourceVisitor < ? , ? > createSourceVisitor ( CompilationUnitTree root ) { } protected SourceVisitor < ? , ? > getInferenceVisitor ( InferenceChecker inferenceChecker , CompilationUnitTree root ) { } @ Override protected MultiGraphFactory createQualifierHierarchyFactory ( ) { } @ Override public boolean isSubtype ( AnnotatedTypeMirror sub , AnnotatedTypeMirror sup ) { } public void setCurrentFactory ( AnnotatedTypeFactory factory ) { } public CompilationUnitTree getRootByElement ( Element elt ) { } public Tree getDeclaration ( Element elt ) { } public boolean isFieldElt ( AnnotatedTypeMirror type , Element fieldElt ) { } public Element getOuterThisElement ( MemberSelectTree mTree , ExecutableElement currentMethodElt ) { } public boolean isAccessOuterThis ( MemberSelectTree mTree ) { } public boolean isExceptionClass ( AnnotatedTypeMirror type ) { } public boolean isFromLibrary ( Element elt ) { } public boolean isCompilerAddedConstructor ( ExecutableElement methodElt ) { MethodTree node = ( ( MethodTree ) ( getDeclaration ( methodElt ) ) ) ; Element enclosingElement = methodElt . getEnclosingElement ( ) ; <START_BUG> if ( ( enclosingElement instanceof TypeElement ) && ( TreeUtils . isConstructor ( node ) ) ) { <END_BUG> if ( node . getParameters ( ) . isEmpty ( ) ) { List < ? extends StatementTree > statements = node . getBody ( ) . getStatements ( ) ; if ( ( ( statements . size ( ) ) == 1 ) && ( statements . get ( 0 ) . toString ( ) . contains ( "super" ) ) ) { CompilationUnitTree root = getRootByElement ( methodElt ) ; long constructorLineNum = positions . getStartPosition ( root , node ) ; constructorLineNum = root . getLineMap ( ) . getLineNumber ( constructorLineNum ) ; ClassTree enclosingClassDecl = ( ( ClassTree ) ( getDeclaration ( enclosingElement ) ) ) ; long classLineNum = positions . getStartPosition ( root , enclosingClassDecl ) ; classLineNum = root . getLineMap ( ) . getLineNumber ( classLineNum ) ; if ( constructorLineNum == classLineNum ) { return true ; } } } } return false ; } public long getLineNumber ( Element elt ) { } public long getLineNumber ( Tree tree ) { } public long getLineNumber ( CompilationUnitTree root , Tree tree ) { } public long getPosition ( Element elt ) { } public long getPosition ( Tree tree ) { } public ExecutableElement getCurrentMethodElt ( ) { } public ExecutableElement getEnclosingMethodWithElt ( ExecutableElement elt ) { } public ExecutableElement getEnclosingMethodWithField ( Element fieldElt ) { } public String getFileName ( Element elt ) { } public String getFileName ( Tree tree ) { } public String getFileName ( CompilationUnitTree root , Tree tree ) { } public String getIdentifier ( Tree tree ) { } public String getIdentifier ( Element elt ) { } public String getName ( ) { } public boolean isAnnotated ( AnnotatedTypeMirror type ) { } public boolean isAnnotated ( Reference ref ) { } public boolean isAnnotated ( Set < AnnotationMirror > annos ) { } public Reference getAnnotatedReferenceByIdentifier ( String identifier ) { } public Reference getAnnotatedReference ( Tree t ) { } public Reference getAnnotatedReference ( Element elt ) { } public Reference getAnnotatedReference ( String identifier , RefKind kind , Tree tree , Element element , TypeElement enclosingType , AnnotatedTypeMirror type ) { } public Reference getAnnotatedReference ( String identifier , RefKind kind , Tree tree , Element element , TypeElement enclosingType , AnnotatedTypeMirror type , Set < AnnotationMirror > annos ) { } public Set < Constraint > getConstraints ( ) { } public Map < String , Reference > getAnnotatedReferences ( ) { } protected void addVisitedClass ( TypeElement te ) { } protected Reference getFieldAdaptReference ( Reference context , Reference decl , Reference assignTo ) { } protected Reference getMethodAdaptReference ( Reference context , Reference decl , Reference assignTo ) { } public void addSubtypeConstraint ( Reference sub , Reference sup , long pos ) { } protected void addEqualityConstraint ( Reference left , Reference right , long pos ) { } protected void addUnequalityConstraint ( Reference left , Reference right ) { } private void addComponentConstraints ( Reference sub , Reference sup , boolean equality , long pos ) { } protected void handleMethodOverride ( ExecutableElement overrider , ExecutableElement overridden ) { } protected void handleInstanceFieldRead ( Reference aBase , Reference aField , Reference aLhs , long pos ) { }

Fix:
if ( ( ( node != null ) && ( enclosingElement instanceof TypeElement ) ) && ( TreeUtils . isConstructor ( node ) ) ) {