Class ThrowingExceptions

All Implemented Interfaces:
Detector, Priorities, org.apache.bcel.classfile.Visitor

public class ThrowingExceptions extends OpcodeStackDetector
  • Field Details

    • bugReporter

      private final BugReporter bugReporter
    • exceptionThrown

      private String exceptionThrown
  • Constructor Details

    • ThrowingExceptions

      public ThrowingExceptions(BugReporter bugReporter)
  • Method Details

    • visit

      public void visit(org.apache.bcel.classfile.Method obj)
      Overrides:
      visit in class BetterVisitor
    • visitAfter

      public void visitAfter(org.apache.bcel.classfile.Code obj)
      Description copied from class: PreorderVisitor
      Called after visiting a code attribute
      Overrides:
      visitAfter in class PreorderVisitor
      Parameters:
      obj - Code that was just visited
    • sawOpcode

      public void sawOpcode(int seen)
      Description copied from class: OpcodeStackDetector

      By default, this method will not be called when stack is TOP. To change this behavior, override #beforeOpcode(int) and change to return true even if stack is TOP.

      see Using FindBugs for Research to learn lattice and what TOP means.

      Specified by:
      sawOpcode in class OpcodeStackDetector
      See Also:
    • reportBug

      private void reportBug(String bugName, XMethod method)
    • parentThrows

      private boolean parentThrows(@NonNull org.apache.bcel.classfile.JavaClass clazz, @NonNull org.apache.bcel.classfile.Method method, @DottedClassName String exception)
    • doesThrowException

      private boolean doesThrowException(org.apache.bcel.classfile.Method m, @DottedClassName String exception)
    • signatureMatches

      private boolean signatureMatches(org.apache.bcel.classfile.Method child, org.apache.bcel.classfile.Method parent)