Class ThreadSafety.Violation
- java.lang.Object
-
- com.google.errorprone.bugpatterns.threadsafety.ThreadSafety.Violation
-
- Enclosing class:
- ThreadSafety
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 Summary
Constructors Constructor Description Violation()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ThreadSafety.Violation
absent()
An empty explanation.static ThreadSafety.Violation
create(org.pcollections.ConsPStack<String> path)
boolean
isPresent()
String
message()
static ThreadSafety.Violation
of(String reason)
Creates an explanation with one step.abstract org.pcollections.ConsPStack<String>
path()
The list of steps in the explanation.ThreadSafety.Violation
plus(String edge)
Adds a step.
-
-
-
Method Detail
-
create
public static ThreadSafety.Violation create(org.pcollections.ConsPStack<String> path)
-
isPresent
public boolean isPresent()
- Returns:
- true if a violation was found
-
message
public String message()
- Returns:
- 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.
-
-