Class FindHiddenMethod

  • All Implemented Interfaces:
    Detector, Priorities

    public class FindHiddenMethod
    extends java.lang.Object
    implements Detector
    This detector finds all the methods of a subclass which are hiding the static methods of the superclass. Please see @see SEI CERT MET07-J
    • Field Detail

    • Constructor Detail

      • FindHiddenMethod

        public FindHiddenMethod​(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
      • isHidingInnerClass

        private boolean isHidingInnerClass​(org.apache.bcel.classfile.Method method)
        This method checks for the inner class exceptional cases. As whenever there an inner class, '.access$' methods are created hiddenly to access the outer class attributes.
      • isAutoGeneratedMethod

        private boolean isAutoGeneratedMethod​(org.apache.bcel.classfile.Method method)
        This method checks for the autoGenerated methods for an inner class - exceptional cases. As whenever there an inner class, '.class$' methods are created hiddenly.
      • isConstructor

        private boolean isConstructor​(org.apache.bcel.classfile.Method method)
        This method is here to check the exceptional case of Constructors