Class BytecodeScanningDetector

All Implemented Interfaces:
Detector, Priorities, org.apache.bcel.classfile.Visitor
Direct Known Subclasses:
BadAppletConstructor, BadlyOverriddenAdapter, BadUseOfReturnValue, BuildInterproceduralCallGraph, CalledMethods, DoInsideDoPrivileged, DontCatchNullPointerException, DontReusePublicIdentifiers, EmptyZipFileEntry, FinalizerNullsFields, FindCircularDependencies, FindEmptySynchronizedBlock, FindFinalizeInvocations, FindFloatMath, FindLocalSelfAssignment2, FindMaskedFields, FindNakedNotify, FindRoughConstants, FindRunInvocations, FindSpinLoop, FindUncalledPrivateMethods, FindUnconditionalWait, FindUninitializedGet, FindUnsyncGet, FindUselessControlFlow, HugeSharedStringConstants, IDivResultCastToDouble, InefficientMemberAccess, InefficientToArray, InheritanceUnsafeGetResource, InitializationChain, InstantiateStaticClass, InvalidJUnitTest, IteratorIdioms, MutableLock, MutableStaticFields, OpcodeStackDetector, PreferZeroLengthArrays, PublicSemaphores, QuestionableBooleanAssignment, ReadReturnShouldBeChecked, ReflectiveClasses, StartInConstructor, SuperfluousInstanceOf, SuspiciousThreadInterrupted, SynchronizeAndNullCheckField, UncallableMethodOfAnonymousClass, UnnecessaryMath, UselessSubclassMethod, VarArgsProblems, VolatileUsage, WaitInLoop, WrongMapIterator, XMLFactoryBypass

public class BytecodeScanningDetector extends DismantleBytecode implements Detector
Base class for Detectors which want to extend DismantleBytecode.
See Also:
  • Constructor Details

    • BytecodeScanningDetector

      public BytecodeScanningDetector()
  • 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
      Parameters:
      classContext - the ClassContext
    • getClassContext

      public ClassContext getClassContext()
      Get the ClassContext of the class currently being visited.
      Returns:
      the current ClassContext
    • shouldVisitCode

      public boolean shouldVisitCode(org.apache.bcel.classfile.Code obj)
      Check see if the Code for this method should be visited.
      Parameters:
      obj - Code attribute
      Returns:
      true if the Code should be visited
    • 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