Class ThreadSafety.Violation

Enclosing class:

public abstract static class ThreadSafety.Violation
extends Object
A human-friendly explanation of a thread safety violations.

An absent explanation indicates either an annotated type with no violations, or a type without the annotation.

  • Constructor Details

    • Violation

      public Violation()
  • Method Details

    • create

      public static ThreadSafety.Violation create​(org.pcollections.ConsPStack<String> path)
    • isPresent

      public boolean isPresent()
      true if a violation was found
    • message

      public String message()
      the explanation
    • path

      public abstract org.pcollections.ConsPStack<String> path()
      The list of steps in the explanation.

      Example: ["Foo has field 'xs' of type 'int[]'", "arrays are not thread-safe"]

    • plus

      public ThreadSafety.Violation plus​(String edge)
      Adds a step.
    • of

      public static ThreadSafety.Violation of​(String reason)
      Creates an explanation with one step.
    • absent

      public static ThreadSafety.Violation absent()
      An empty explanation.