Class Violation

    • 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 by vioString.
        Parameters:
        vioString - : a the string is of the form: <INVINFO> property time</INVINFO> where property is valid XML representation of a Property, and time is <ON_ENTRY> or <ON_EXIT>.
        Returns:
        the violation represented by vioString
      • get

        public static Violation get​(Property property)
        if property is an entry or exit property, returns the violation corresponding to this property. If it's an object invariant property, throws an exception.
      • xmlString

        public String xmlString()
        The XML String representing this property.
      • toString

        @SideEffectFree
        public String toString​(@GuardSatisfied Violation this)
        String representation.
        Overrides:
        toString in class Object
      • 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.
        Overrides:
        equals in class Object
      • hashCode

        @Pure
        public int hashCode​(@GuardSatisfied @UnknownSignedness Violation this)
        Overrides:
        hashCode in class Object
      • viosWithConfGEQ

        public static Violation[] viosWithConfGEQ​(Violation[] vios,
                                                  double thresh)
        Returns all violations in vios that violate properties with confidence greater than or equal to thresh.
      • viosWithConfLT

        public static Violation[] viosWithConfLT​(Violation[] vios,
                                                 double thresh)
        Returns all violations in vios that violate properties with confidence less than thresh.
      • 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 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".