Skip navigation links
  • Overview
  • Package
  • Class
  • Use
  • Tree
  • Deprecated
  • Index
  • Help

Deprecated API

Contents

  • Interfaces
  • Annotation Types
  • Methods
  • Constructors
  • Annotation Type Elements
  • Deprecated Interfaces
    Interface
    Description
    com.google.errorprone.matchers.method.MethodMatchers.AnyMethodMatcher
    use Matcher<ExpressionTree> instead of referring directly to this type.
    com.google.errorprone.matchers.method.MethodMatchers.ConstructorClassMatcher
    use Matcher<ExpressionTree> instead of referring directly to this type.
    com.google.errorprone.matchers.method.MethodMatchers.ConstructorMatcher
    use Matcher<ExpressionTree> instead of referring directly to this type.
    com.google.errorprone.matchers.method.MethodMatchers.InstanceMethodMatcher
    use Matcher<ExpressionTree> instead of referring directly to this type.
    com.google.errorprone.matchers.method.MethodMatchers.MethodClassMatcher
    use Matcher<ExpressionTree> instead of referring directly to this type.
    com.google.errorprone.matchers.method.MethodMatchers.MethodMatcher
    use Matcher<ExpressionTree> instead of referring directly to this type.
    com.google.errorprone.matchers.method.MethodMatchers.MethodNameMatcher
    use Matcher<ExpressionTree> instead of referring directly to this type.
    com.google.errorprone.matchers.method.MethodMatchers.MethodSignatureMatcher
    use Matcher<ExpressionTree> instead of referring directly to this type.
    com.google.errorprone.matchers.method.MethodMatchers.ParameterMatcher
    use Matcher<ExpressionTree> instead of referring directly to this type.
    com.google.errorprone.matchers.method.MethodMatchers.StaticMethodMatcher
    use Matcher<ExpressionTree> instead of referring directly to this type.
  • Deprecated Annotation Types
    Annotation Type
    Description
    com.google.errorprone.annotations.concurrent.LockMethod
    the correctness of this annotation is not enforced; it will soon be removed.
    com.google.errorprone.annotations.concurrent.UnlockMethod
    the correctness of this annotation is not enforced; it will soon be removed.
  • Deprecated Methods
    Method
    Description
    com.google.errorprone.annotations.IncompatibleModifiers.value()
    use IncompatibleModifiers.modifier() instead
    com.google.errorprone.annotations.RequiredModifiers.value()
    use RequiredModifiers.modifier() instead
    com.google.errorprone.BugCheckerRefactoringTestHelper.newInstance(BugChecker, Class<?>)
    prefer BugCheckerRefactoringTestHelper.newInstance(Class, Class)
    com.google.errorprone.BugPattern.generateExamplesFromTestCases()
    this is a no-op that will be removed in the future
    com.google.errorprone.bugpatterns.apidiff.ApiDiffProto.ClassDiff.DiffCase.valueOf(int)
    com.google.errorprone.bugpatterns.BugChecker.isSuppressed(Tree)
    use BugChecker.isSuppressed(Tree, VisitorState) instead
    com.google.errorprone.bugpatterns.BugChecker.isSuppressed(Symbol)
    use BugChecker.isSuppressed(Symbol, VisitorState) instead
    com.google.errorprone.bugpatterns.threadsafety.WellKnownMutability.getKnownSafeClasses()
    WellKnownMutability.getKnownImmutableClasses() is clearer if you're dealing with this specific class.
    com.google.errorprone.bugpatterns.threadsafety.WellKnownMutability.getKnownUnsafeClasses()
    WellKnownMutability.getKnownMutableClasses() is clearer if you're dealing with this specific class.
    com.google.errorprone.ErrorProneError.logFatalError(Log)
    prefer ErrorProneError.logFatalError(Log, Context)
    com.google.errorprone.fixes.Replacements.descending()
    com.google.errorprone.fixes.SuggestedFixes.updateAnnotationArgumentValues(AnnotationTree, String, Collection<String>)
    use SuggestedFixes.updateAnnotationArgumentValues(AnnotationTree, VisitorState, String, Collection) instead
    com.google.errorprone.matchers.Description.Builder.addFix(Optional<? extends Fix>)
    prefer referring to empty fixes using SuggestedFix.emptyFix().
    com.google.errorprone.matchers.Matchers.isNonNull()
    use Matchers.isNonNullUsingDataflow() instead.
    com.google.errorprone.matchers.Matchers.isNull()
    use Matchers.isNullUsingDataflow() instead.
    com.google.errorprone.util.ASTHelpers.getAnnotation(Tree, Class<T>)
    If annotationClass contains a member that is a Class or an array of them, attempting to access that member from the Error Prone checker code will result in a runtime exception. Instead, operate on getSymbol(tree).getAnnotationMirrors() to meta-syntactically inspect the annotation. Note that this method (and the getSymbol-based replacement suggested above) looks for annotations not just on the given tree (such as a MethodTree) but also on the symbol referred to by the given tree (such as on the Symbol.MethodSymbol that is being called by the given MethodInvocationTree). If you want to examine annotations only on the given tree, then use ASTHelpers.getAnnotations(com.sun.source.tree.Tree) (or a direct call to a getAnnotations method declared on a specific Tree subclass) instead.
    com.google.errorprone.util.ASTHelpers.getAnnotation(Symbol, Class<T>)
    If annotationClass contains a member that is a Class or an array of them, attempting to access that member from the Error Prone checker code will result in a runtime exception. Instead, operate on sym.getAnnotationMirrors() to meta-syntactically inspect the annotation.
    com.google.errorprone.util.ASTHelpers.hasAnnotation(Tree, Class<? extends Annotation>, VisitorState)
    prefer ASTHelpers.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 classpaths
    com.google.errorprone.util.ASTHelpers.hasAnnotation(Symbol, Class<? extends Annotation>, VisitorState)
    prefer ASTHelpers.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 classpaths
    com.google.errorprone.util.ASTHelpers.hasNoExplicitType(VariableTree, VisitorState)
    use ASTHelpers.hasImplicitType(VariableTree, VisitorState) instead
  • Deprecated Constructors
    Constructor
    Description
    com.google.errorprone.VisitorState(Context)
    If VisitorState is needed, use VisitorState.createForUtilityPurposes(com.sun.tools.javac.util.Context), otherwise just use utility methods in ASTHelpers that don't need VisitorSate.
    com.google.errorprone.VisitorState(Context, DescriptionListener)
    Use the equivalent factory method VisitorState.createForCustomFindingCollection(com.sun.tools.javac.util.Context, com.google.errorprone.DescriptionListener).
    com.google.errorprone.VisitorState(Context, DescriptionListener, Map<String, BugPattern.SeverityLevel>, ErrorProneOptions)
    Use the equivalent factory method VisitorState.createConfiguredForCompilation(com.sun.tools.javac.util.Context, com.google.errorprone.DescriptionListener, java.util.Map<java.lang.String, com.google.errorprone.BugPattern.SeverityLevel>, com.google.errorprone.ErrorProneOptions).
  • Deprecated Annotation Type Elements
    Annotation Type Element
    Description
    com.google.errorprone.annotations.IncompatibleModifiers.value()
    use IncompatibleModifiers.modifier() instead
    com.google.errorprone.annotations.RequiredModifiers.value()
    use RequiredModifiers.modifier() instead
    com.google.errorprone.BugPattern.generateExamplesFromTestCases()
    this is a no-op that will be removed in the future

Copyright © 2023 Google LLC. All rights reserved.