Class DroppedException

    • Field Detail

      • DEBUG

        private static final boolean DEBUG
      • LOOK_IN_SOURCE_TO_FIND_COMMENTED_CATCH_BLOCKS

        private static final boolean LOOK_IN_SOURCE_TO_FIND_COMMENTED_CATCH_BLOCKS
      • causes

        java.util.Set<java.lang.String> causes
      • checkedCauses

        java.util.Set<java.lang.String> checkedCauses
      • NUM_CONTEXT_LINES

        private static final int NUM_CONTEXT_LINES
        Maximum number of lines we look backwards to find the "catch" keyword. Looking backwards is necessary when the indentation style puts the open brace on a different line from the catch clause.
        See Also:
        Constant Field Values
      • MAX_LINES

        private static final int MAX_LINES
        The number of lines that we'll scan to look at the source for a catch block.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DroppedException

        public DroppedException​(BugReporter bugReporter)
    • Method Detail

      • visitClassContext

        public void visitClassContext​(ClassContext classContext)
        Description copied from interface: Detector
        Visit the ClassContext for a class which should be analyzed for instances of bug patterns.
        Specified by:
        visitClassContext in interface Detector
        Parameters:
        classContext - the ClassContext
      • report

        public void report()
        Description copied from interface: Detector
        This method is called after all classes to be visited. It should be used by any detectors which accumulate information over all visited classes to generate results.
        Specified by:
        report in interface Detector
      • isChecked

        boolean isChecked​(java.lang.String c)
      • getUnsignedShort

        private int getUnsignedShort​(byte[] a,
                                     int i)
      • visit

        public void visit​(org.apache.bcel.classfile.Code obj)
        Overrides:
        visit in class BetterVisitor
      • getNextExecutableLineNumber

        private int getNextExecutableLineNumber​(org.apache.bcel.classfile.LineNumberTable linenumbers,
                                                int PC)
      • catchBlockHasComment

        private boolean catchBlockHasComment​(SourceLineAnnotation srcLine)
        Analyze a class's source code to see if there is a comment (or other text) in a catch block we have marked as dropping an exception.
        Returns:
        true if there is a comment in the catch block, false if not (or if we can't tell)