Class FindUnsatisfiedObligation.MethodChecker

java.lang.Object
edu.umd.cs.findbugs.detect.FindUnsatisfiedObligation.MethodChecker
Enclosing class:
FindUnsatisfiedObligation

private class FindUnsatisfiedObligation.MethodChecker extends Object
A helper class to check a single method for unsatisfied obligations. Avoids having to pass millions of parameters to each method (type dataflow, null value dataflow, etc.).
  • Field Details

  • Constructor Details

  • Method Details

    • analyzeMethod

      public void analyzeMethod() throws CheckedAnalysisException
      Throws:
      CheckedAnalysisException
    • checkStateForLeakedObligations

      private void checkStateForLeakedObligations(State state, Map<Obligation,State> leakedObligationMap) throws IllegalStateException
      Throws:
      IllegalStateException
    • reportWarning

      private void reportWarning(Obligation obligation, State state, StateSet factAtExit)
    • annotateWarningWithSourceLineInformation

      private void annotateWarningWithSourceLineInformation(State state, Obligation obligation, BugInstance bugInstance)
    • getAdjustedLeakCount

      private int getAdjustedLeakCount(State state, int obligationId)
      Get the adjusted leak count for the given State and obligation type. Use heuristics to account for:
      • null checks (count the number of times the supposedly leaked obligation is compared to null, and subtract those from the leak count)
      • field assignments (count number of times obligation type is assigned to a field, and subtract those from the leak count)
      • return statements (if an instance of the obligation type is returned from the method, subtract one from leak count)
      Returns:
      the adjusted leak count (positive if leaked obligation, negative if attempt to release an un-acquired obligation)
    • isPossibleInstanceOfObligationType

      private boolean isPossibleInstanceOfObligationType(Subtypes2 subtypes2, org.apache.bcel.generic.ObjectType type, org.apache.bcel.generic.ObjectType obligationType) throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • reportPath

      private void reportPath(BugInstance bugInstance, Obligation obligation, State state)