Package daikon.tools.runtimechecker
Class Violation
- Object
-
- Violation
-
- All Implemented Interfaces:
Serializable
public class Violation extends Object implements Serializable
Represents a violation of aProperty
.- See Also:
Property
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Violation.Time
Indicates at which program point the violation occurred: at method entry or method exit.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(@GuardSatisfied @Nullable Object o)
Two violations are equal if their properties and times are equal.static Violation[]
findViolations(String vioString)
Looks for legal XML representation of violations in the given string, and returns all violations that are successfully parsed.static Violation
get(Property property)
ifproperty
is an entry or exit property, returns the violation corresponding to this property.static Violation
get(Property anno, Violation.Time t)
Returns a violation with the given attributes.static Violation
get(String vioString)
Creates the violation represented byvioString
.int
hashCode()
Property
property()
The violated property.Violation.Time
time()
The time at which the violation happened (entry or exit from method).String
toNiceString(String prefix, double confidenceThreshold)
static String
toNiceString(String prefix, Set<Violation> vios, double confidenceThreshold)
A human-readable String representation of a list of violations.String
toString()
String representation.String
toStringWithMethod()
String representation.static Violation[]
viosWithConfGEQ(Violation[] vios, double thresh)
Returns all violations invios
that violate properties with confidence greater than or equal tothresh
.static Violation[]
viosWithConfLT(Violation[] vios, double thresh)
Returns all violations invios
that violate properties with confidence less thanthresh
.static Violation[]
withKind(Violation[] vios, Property.Kind kind)
Returns all violations invios
with the given king.static Violation[]
withTime(Violation[] vios, Violation.Time time)
Returns all violations invios
with the given time.String
xmlString()
The XML String representing this property.
-
-
-
Method Detail
-
time
public Violation.Time time()
The time at which the violation happened (entry or exit from method).
-
get
public static Violation get(String vioString)
Creates the violation represented byvioString
.- Parameters:
vioString
- : a the string is of the form:<INVINFO> property time</INVINFO>
whereproperty
is valid XML representation of aProperty
, and time is<ON_ENTRY>
or<ON_EXIT>
.- Returns:
- the violation represented by
vioString
-
get
public static Violation get(Property anno, Violation.Time t)
Returns a violation with the given attributes.
-
get
public static Violation get(Property property)
ifproperty
is an entry or exit property, returns the violation corresponding to this property. If it's an object invariant property, throws an exception.
-
toString
@SideEffectFree public String toString(@GuardSatisfied Violation this)
String representation.
-
toStringWithMethod
@SideEffectFree public String toStringWithMethod(@GuardSatisfied Violation this)
String representation.
-
equals
@EnsuresNonNullIf(result=true, expression="#1") @Pure public boolean equals(@GuardSatisfied Violation this, @GuardSatisfied @Nullable Object o)
Two violations are equal if their properties and times are equal.
-
hashCode
@Pure public int hashCode(@GuardSatisfied @UnknownSignedness Violation this)
-
viosWithConfGEQ
public static Violation[] viosWithConfGEQ(Violation[] vios, double thresh)
Returns all violations invios
that violate properties with confidence greater than or equal tothresh
.
-
viosWithConfLT
public static Violation[] viosWithConfLT(Violation[] vios, double thresh)
Returns all violations invios
that violate properties with confidence less thanthresh
.
-
withTime
public static Violation[] withTime(Violation[] vios, Violation.Time time)
Returns all violations invios
with the given time.
-
withKind
public static Violation[] withKind(Violation[] vios, Property.Kind kind)
Returns all violations invios
with the given king.
-
findViolations
public static Violation[] findViolations(String vioString)
Looks for legal XML representation of violations in the given string, and returns all violations that are successfully parsed.
-
toNiceString
public String toNiceString(String prefix, double confidenceThreshold)
-
toNiceString
public static String toNiceString(String prefix, Set<Violation> vios, double confidenceThreshold)
A human-readable String representation of a list of violations. The violations are sorted by "time" (which is not the same as sorting them by time!) and violations of high-confidence properties are prepended with "H".
-
-