Package edu.umd.cs.findbugs.detect
Class UselessSubclassMethod
- java.lang.Object
-
- All Implemented Interfaces:
Detector,Priorities,StatelessDetector,java.lang.Cloneable,org.apache.bcel.classfile.Visitor
public class UselessSubclassMethod extends BytecodeScanningDetector implements StatelessDetector
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classUselessSubclassMethod.State
-
Field Summary
Fields Modifier and Type Field Description private org.apache.bcel.generic.Type[]argTypesprivate BugReporterbugReporterprivate intcurParmprivate intcurParmOffsetprivate java.util.Set<java.lang.String>interfaceMethodsprivate intinvokePCprivate UselessSubclassMethod.Statestateprivate java.lang.StringsuperclassName-
Fields inherited from class edu.umd.cs.findbugs.visitclass.DismantleBytecode
codeBytes, lineNumberTable, M_BR, M_CP, M_INT, M_PAD, M_R, M_UINT
-
Fields inherited from interface edu.umd.cs.findbugs.Priorities
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description UselessSubclassMethod(BugReporter bugReporter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckParm(int seen, int fastOpBase, int slowOp, int parmSize)private booleandifferentAttributes(org.apache.bcel.classfile.Method m1, org.apache.bcel.classfile.Method m2)private org.apache.bcel.classfile.MethodfindSuperclassMethod(java.lang.String superclassName, org.apache.bcel.classfile.Method subclassMethod)java.lang.StringgetPackage(java.lang.String classname)booleansamePackage(java.lang.String classname1, java.lang.String classname2)voidsawOpcode(int seen)(package private) java.util.HashSet<java.lang.String>thrownExceptions(org.apache.bcel.classfile.Method m)voidvisitAfter(org.apache.bcel.classfile.JavaClass obj)voidvisitClassContext(ClassContext classContext)Visit the ClassContext for a class which should be analyzed for instances of bug patterns.voidvisitCode(org.apache.bcel.classfile.Code obj)voidvisitMethod(org.apache.bcel.classfile.Method obj)-
Methods inherited from class edu.umd.cs.findbugs.BytecodeScanningDetector
getClassContext, report, shouldVisitCode
-
Methods inherited from class edu.umd.cs.findbugs.visitclass.DismantleBytecode
afterOpcode, areOppositeBranches, atCatchBlock, beforeOpcode, getBranchFallThrough, getBranchOffset, getBranchTarget, getClassConstantOperand, getClassDescriptorOperand, getCodeByte, getConstantRefOperand, getDefaultSwitchOffset, getDottedClassConstantOperand, getFieldDescriptorOperand, getIntConstant, getLongConstant, getMaxPC, getMethodDescriptorOperand, getNameConstantOperand, getNextCodeByte, getNextOpcode, getNextPC, getOpcode, getPC, getPrevOpcode, getRefConstantOperand, getRefFieldIsStatic, getRegisterOperand, getSigConstantOperand, getStringConstantOperand, getSwitchLabels, getSwitchOffsets, getXClassOperand, getXFieldOperand, getXMethodOperand, isBranch, isMethodCall, isRegisterLoad, isRegisterStore, isRegisterStore, isReturn, isShift, isSwitch, isWideOpcode, printOpCode, sawBranchTo, sawClass, sawDouble, sawField, sawFloat, sawIMethod, sawInt, sawLong, sawMethod, sawRegister, sawString, visit
-
Methods inherited from class edu.umd.cs.findbugs.visitclass.AnnotationVisitor
getAnnotationParameterAsEnum, getAnnotationParameterAsString, getAnnotationParameterAsStringArray, visitAnnotation, visitAnnotation, visitParameterAnnotation, visitParameterAnnotation, visitSyntheticParameterAnnotation
-
Methods inherited from class edu.umd.cs.findbugs.visitclass.PreorderVisitor
amVisitingMainMethod, asUnsignedByte, doVisitMethod, getClassDescriptor, getClassName, getCode, getConstantPool, getDottedClassName, getDottedFieldSig, getDottedMethodSig, getDottedSuperclassName, getField, getFieldDescriptor, getFieldIsStatic, getFieldName, getFieldSig, getFullyQualifiedFieldName, getFullyQualifiedMethodName, getMethod, getMethodDescriptor, getMethodName, getMethodSig, getMethodVisitOrder, getNumberArguments, getNumberMethodArguments, getPackageName, getSizeOfSurroundingTryBlock, getSizeOfSurroundingTryBlock, getSourceFile, getStringFromIndex, getSuperclassName, getSurroundingCaughtExceptions, getSurroundingCaughtExceptions, getSurroundingCaughtExceptionTypes, getSurroundingTryBlock, getSurroundingTryBlock, getThisClass, getXClass, getXField, getXMethod, hasInterestingClass, hasInterestingMethod, isVisitMethodsInCallOrder, setupVisitorForClass, setVisitMethodsInCallOrder, shouldVisit, toString, visitAfter, visitAnnotationDefault, visitAnnotationEntry, visitBootstrapMethods, visitConstantInvokeDynamic, visitConstantMethodHandle, visitConstantMethodType, visitConstantModule, visitConstantPackage, visitConstantPool, visitEnclosingMethod, visitingField, visitingMethod, visitInnerClasses, visitJavaClass, visitLineNumberTable, visitLocalVariableTable, visitMethodParameters, visitParameterAnnotationEntry, visitStackMap, visitStackMapEntry
-
Methods inherited from class edu.umd.cs.findbugs.visitclass.BetterVisitor
clone, report, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitCodeException, visitConstantClass, visitConstantDouble, visitConstantFieldref, visitConstantFloat, visitConstantInteger, visitConstantInterfaceMethodref, visitConstantLong, visitConstantMethodref, visitConstantNameAndType, visitConstantString, visitConstantUtf8, visitConstantValue, visitDeprecated, visitExceptionTable, visitField, visitInnerClass, visitLineNumber, visitLocalVariable, visitLocalVariableTypeTable, visitSignature, visitSourceFile, visitSynthetic, visitUnknown
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.umd.cs.findbugs.StatelessDetector
clone
-
Methods inherited from interface org.apache.bcel.classfile.Visitor
visitConstantDynamic, visitMethodParameter, visitModule, visitModuleExports, visitModuleMainClass, visitModuleOpens, visitModulePackages, visitModuleProvides, visitModuleRequires, visitNestHost, visitNestMembers, visitRecord, visitRecordComponent, visitStackMapType
-
-
-
-
Field Detail
-
bugReporter
private final BugReporter bugReporter
-
superclassName
@DottedClassName private java.lang.String superclassName
-
state
private UselessSubclassMethod.State state
-
curParm
private int curParm
-
curParmOffset
private int curParmOffset
-
invokePC
private int invokePC
-
argTypes
private org.apache.bcel.generic.Type[] argTypes
-
interfaceMethods
private java.util.Set<java.lang.String> interfaceMethods
-
-
Constructor Detail
-
UselessSubclassMethod
public UselessSubclassMethod(BugReporter bugReporter)
-
-
Method Detail
-
visitClassContext
public void visitClassContext(ClassContext classContext)
Description copied from interface:DetectorVisit the ClassContext for a class which should be analyzed for instances of bug patterns.- Specified by:
visitClassContextin interfaceDetector- Overrides:
visitClassContextin classBytecodeScanningDetector- Parameters:
classContext- the ClassContext
-
visitAfter
public void visitAfter(org.apache.bcel.classfile.JavaClass obj)
- Overrides:
visitAfterin classPreorderVisitor
-
visitMethod
public void visitMethod(org.apache.bcel.classfile.Method obj)
- Specified by:
visitMethodin interfaceorg.apache.bcel.classfile.Visitor- Overrides:
visitMethodin classBetterVisitor
-
visitCode
public void visitCode(org.apache.bcel.classfile.Code obj)
- Specified by:
visitCodein interfaceorg.apache.bcel.classfile.Visitor- Overrides:
visitCodein classPreorderVisitor
-
getPackage
public java.lang.String getPackage(@DottedClassName java.lang.String classname)
-
samePackage
public boolean samePackage(@DottedClassName java.lang.String classname1, @DottedClassName java.lang.String classname2)
-
sawOpcode
public void sawOpcode(int seen)
- Overrides:
sawOpcodein classDismantleBytecode
-
checkParm
private void checkParm(int seen, int fastOpBase, int slowOp, int parmSize)
-
findSuperclassMethod
private org.apache.bcel.classfile.Method findSuperclassMethod(@DottedClassName java.lang.String superclassName, org.apache.bcel.classfile.Method subclassMethod) throws java.lang.ClassNotFoundException
- Throws:
java.lang.ClassNotFoundException
-
thrownExceptions
java.util.HashSet<java.lang.String> thrownExceptions(org.apache.bcel.classfile.Method m)
-
differentAttributes
private boolean differentAttributes(org.apache.bcel.classfile.Method m1, org.apache.bcel.classfile.Method m2)
-
-