Class WellKnownMutability

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

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

    • fromFlags

      public static WellKnownMutability fromFlags​(ErrorProneFlags flags)
    • getKnownImmutableClasses

      public Map<String,​AnnotationInfo> getKnownImmutableClasses()
    • getKnownSafeClasses

      public Map<String,​AnnotationInfo> getKnownSafeClasses()
      Description copied from interface: ThreadSafety.KnownTypes
      Types that are known to be safe even if they're not annotated with an expected annotation.
      Specified by:
      getKnownSafeClasses in interface ThreadSafety.KnownTypes
    • getKnownUnsafeClasses

      public Set<String> getKnownUnsafeClasses()
      Description copied from interface: ThreadSafety.KnownTypes
      Types that are known to be unsafe and don't need testing.
      Specified by:
      getKnownUnsafeClasses in interface ThreadSafety.KnownTypes
    • 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.
    • isAnnotation

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