Deprecated API
Contents
-
Deprecated InterfacesInterfaceDescriptionuse
Matcher<ExpressionTree>instead of referring directly to this type.useMatcher<ExpressionTree>instead of referring directly to this type.useMatcher<ExpressionTree>instead of referring directly to this type.useMatcher<ExpressionTree>instead of referring directly to this type.useMatcher<ExpressionTree>instead of referring directly to this type.useMatcher<ExpressionTree>instead of referring directly to this type.useMatcher<ExpressionTree>instead of referring directly to this type.useMatcher<ExpressionTree>instead of referring directly to this type.useMatcher<ExpressionTree>instead of referring directly to this type.useMatcher<ExpressionTree>instead of referring directly to this type.
-
Deprecated MethodsMethodDescriptionuse
BugChecker.isSuppressed(Tree, VisitorState)insteaduseBugChecker.isSuppressed(Symbol, VisitorState)insteadprefer referring to empty fixes usingSuggestedFix.emptyFix().useMatchers.isNonNullUsingDataflow()instead.useMatchers.isNullUsingDataflow()instead.The implementation uses javac internals to pretty-print the signatures, and the signature format is not well-specified.IfannotationClasscontains a member that is aClassor an array of them, attempting to access that member from the Error Prone checker code will result in a runtime exception. Instead, operate ongetSymbol(tree).getAnnotationMirrors()to meta-syntactically inspect the annotation. Note that this method (and thegetSymbol-based replacement suggested above) looks for annotations not just on the given tree (such as aMethodTree) but also on the symbol referred to by the given tree (such as on theSymbol.MethodSymbolthat is being called by the givenMethodInvocationTree). If you want to examine annotations only on the given tree, then useASTHelpers.getAnnotations(Tree)(or a direct call to agetAnnotationsmethod declared on a specificTreesubclass) instead.IfannotationClasscontains a member that is aClassor an array of them, attempting to access that member from the Error Prone checker code will result in a runtime exception. Instead, operate onsym.getAnnotationMirrors()to meta-syntactically inspect the annotation.TODO(ghm): delete after a JavaBuilder releasecom.google.errorprone.util.ASTHelpers.hasAnnotation(Tree, Class<? extends Annotation>, VisitorState) preferASTHelpers.hasAnnotation(Symbol, String, VisitorState)to avoid needing a runtime dependency on the annotation class, and to prevent issues if there is skew between the definition of the annotation on the runtime and compile-time classpathspreferASTHelpers.hasAnnotation(Symbol, String, VisitorState)to avoid needing a runtime dependency on the annotation class, and to prevent issues if there is skew between the definition of the annotation on the runtime and compile-time classpathsuse@com.google.errorprone.bugpatterns.WellKnownKeepinstead.use TargetType.targetType directly
-
Deprecated ConstructorsConstructorDescriptionIf VisitorState is needed, use
VisitorState.createForUtilityPurposes(Context), otherwise just use utility methods in ASTHelpers that don't need VisitorSate.Use the equivalent factory methodVisitorState.createForCustomFindingCollection(Context, DescriptionListener).Use the equivalent factory methodVisitorState.createConfiguredForCompilation(Context, DescriptionListener, Map, ErrorProneOptions).