Class WellKnownMutability

java.lang.Object
com.google.errorprone.bugpatterns.threadsafety.WellKnownMutability
All Implemented Interfaces:
ThreadSafetyKnownTypes

@Immutable public final class WellKnownMutability extends Object implements ThreadSafetyKnownTypes
A collection of types with known mutability.
  • Method Details

    • fromFlags

      public static WellKnownMutability fromFlags(ErrorProneFlags flags)
    • getKnownImmutableClasses

      public com.google.common.collect.ImmutableMap<String,AnnotationInfo> getKnownImmutableClasses()
    • getKnownSafeClasses

      @Deprecated public com.google.common.collect.ImmutableMap<String,AnnotationInfo> getKnownSafeClasses()
      Deprecated.
      getKnownImmutableClasses() is clearer if you're dealing with this specific class.
      Description copied from interface: ThreadSafetyKnownTypes
      Types that are known to be safe even if they're not annotated with an expected annotation.
      Specified by:
      getKnownSafeClasses in interface ThreadSafetyKnownTypes
    • getKnownMutableClasses

      public com.google.common.collect.ImmutableSet<String> getKnownMutableClasses()
    • getKnownUnsafeClasses

      @Deprecated public com.google.common.collect.ImmutableSet<String> getKnownUnsafeClasses()
      Deprecated.
      getKnownMutableClasses() is clearer if you're dealing with this specific class.
      Description copied from interface: ThreadSafetyKnownTypes
      Types that are known to be unsafe and don't need testing.
      Specified by:
      getKnownUnsafeClasses in interface ThreadSafetyKnownTypes
    • isProto2MessageClass

      public static boolean isProto2MessageClass(VisitorState state, com.sun.tools.javac.code.Type type)
      Compile-time equivalent of com.google.io.protocol.ProtocolSupport#isProto2MessageClass.
    • isProto2MutableMessageClass

      public static boolean isProto2MutableMessageClass(VisitorState state, com.sun.tools.javac.code.Type type)
      Compile-time equivalent of com.google.io.protocol.ProtocolSupport#isProto2MutableMessageClass.
    • isProtoEnum

      public static boolean isProtoEnum(VisitorState state, com.sun.tools.javac.code.Type type)
    • isAnnotation

      public static boolean isAnnotation(VisitorState state, com.sun.tools.javac.code.Type type)
      Returns true if the type is an annotation.