Class UselessSubclassMethod

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

public class UselessSubclassMethod extends BytecodeScanningDetector implements StatelessDetector
  • Field Details

    • bugReporter

      private final BugReporter bugReporter
    • superclassName

      @DottedClassName private String superclassName
    • state

    • curParm

      private int curParm
    • curParmOffset

      private int curParmOffset
    • invokePC

      private int invokePC
    • argTypes

      private org.apache.bcel.generic.Type[] argTypes
    • interfaceMethods

      private Set<String> interfaceMethods
  • Constructor Details

    • UselessSubclassMethod

      public UselessSubclassMethod(BugReporter bugReporter)
  • Method Details

    • 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
      Overrides:
      visitClassContext in class BytecodeScanningDetector
      Parameters:
      classContext - the ClassContext
    • visitAfter

      public void visitAfter(org.apache.bcel.classfile.JavaClass obj)
      Overrides:
      visitAfter in class PreorderVisitor
    • visitMethod

      public void visitMethod(org.apache.bcel.classfile.Method obj)
      Specified by:
      visitMethod in interface org.apache.bcel.classfile.Visitor
      Overrides:
      visitMethod in class BetterVisitor
    • visitCode

      public void visitCode(org.apache.bcel.classfile.Code obj)
      Specified by:
      visitCode in interface org.apache.bcel.classfile.Visitor
      Overrides:
      visitCode in class PreorderVisitor
    • getPackage

      public String getPackage(@DottedClassName String classname)
    • samePackage

      public boolean samePackage(@DottedClassName String classname1, @DottedClassName String classname2)
    • sawOpcode

      public void sawOpcode(int seen)
      Overrides:
      sawOpcode in class DismantleBytecode
    • checkParm

      private void checkParm(int seen, int fastOpBase, int slowOp, int parmSize)
    • findSuperclassMethod

      private org.apache.bcel.classfile.Method findSuperclassMethod(@DottedClassName String superclassName, org.apache.bcel.classfile.Method subclassMethod) throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • thrownExceptions

      HashSet<String> thrownExceptions(org.apache.bcel.classfile.Method m)
    • differentAttributes

      private boolean differentAttributes(org.apache.bcel.classfile.Method m1, org.apache.bcel.classfile.Method m2)