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 Annotation InterfacesAnnotation InterfaceDescriptionthe correctness of this annotation is not enforced; it will soon be removed.the correctness of this annotation is not enforced; it will soon be removed.
-
Deprecated MethodsMethodDescriptionprefer
BugCheckerRefactoringTestHelper.addInputLines(String, String...). Declaring tests in the same file using text blocks is more readable, as it encourages writing small, focussed tests.preferBugCheckerRefactoringTestHelper.doTest(), which is equivalent todoTest(TEXT_MATCH).BugCheckerRefactoringTestHelper.TestMode.TEXT_MATCHformats the actual and expected output to be lenient of whitespace differences.BugCheckerRefactoringTestHelper.TestMode.AST_MATCHwill ignore differences in comments, and may miss other differences that aren't detectable in the AST.preferBugCheckerRefactoringTestHelper.ExpectOutput.addOutputLines(String, String...). Declaring tests in the same file using text blocks is more readable, as it encourages writing small, focussed tests.this is a no-op that will be removed in the futureWellKnownMutability.getKnownImmutableClasses()is clearer if you're dealing with this specific class.WellKnownMutability.getKnownMutableClasses()is clearer if you're dealing with this specific class.preferCompilationTestHelper.addSourceLines(String, String...). Declaring tests in the same file using text blocks is more readable, as it encourages writing small, focussed tests.prefer referring to empty fixes usingSuggestedFix.emptyFix().useMatchers.isNonNullUsingDataflow()instead.useMatchers.isNullUsingDataflow()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 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 Enum ConstantsEnum ConstantDescriptionprefer
BugCheckerRefactoringTestHelper.TestMode.TEXT_MATCH, which formats the actual and expected output to be lenient of whitespace differences.BugCheckerRefactoringTestHelper.TestMode.AST_MATCHwill ignore differences in comments, and may miss other differences that aren't detectable in the AST.
-
Deprecated Annotation Interface ElementsAnnotation Interface ElementDescriptionthis is a no-op that will be removed in the future