Class FindHEmismatch

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

public class FindHEmismatch extends OpcodeStackDetector implements StatelessDetector
  • Field Details

    • mapPattern

      static final Pattern mapPattern
    • hashTablePattern

      static final Pattern hashTablePattern
    • setPattern

      static final Pattern setPattern
    • predicateOverAnInstance

      static final Pattern predicateOverAnInstance
    • isApplicationClass

      boolean isApplicationClass
    • hasFields

      boolean hasFields
    • visibleOutsidePackage

      boolean visibleOutsidePackage
    • hasHashCode

      boolean hasHashCode
    • hasEqualsObject

      boolean hasEqualsObject
    • hashCodeIsAbstract

      boolean hashCodeIsAbstract
    • equalsObjectIsAbstract

      boolean equalsObjectIsAbstract
    • equalsMethodIsInstanceOfEquals

      boolean equalsMethodIsInstanceOfEquals
    • hasCompareToObject

      boolean hasCompareToObject
    • hasCompareToBridgeMethod

      boolean hasCompareToBridgeMethod
    • hasEqualsSelf

      boolean hasEqualsSelf
    • hasEqualsOther

      boolean hasEqualsOther
    • hasCompareToSelf

      boolean hasCompareToSelf
    • extendsObject

      boolean extendsObject
    • equalsMethod

      MethodAnnotation equalsMethod
    • equalsOtherMethod

      MethodAnnotation equalsOtherMethod
    • equalsOtherClass

      ClassDescriptor equalsOtherClass
    • compareToMethod

      MethodAnnotation compareToMethod
    • compareToObjectMethod

      MethodAnnotation compareToObjectMethod
    • compareToSelfMethod

      MethodAnnotation compareToSelfMethod
    • hashCodeMethod

      MethodAnnotation hashCodeMethod
    • nonHashableClasses

      final HashSet<String> nonHashableClasses
    • potentialBugs

    • bugReporter

      private final BugReporter bugReporter
  • Constructor Details

    • FindHEmismatch

      public FindHEmismatch(BugReporter bugReporter)
  • Method Details

    • isHashableClassName

      public boolean isHashableClassName(String dottedClassName)
    • visitAfter

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

      public void visit(org.apache.bcel.classfile.JavaClass obj)
      Overrides:
      visit in class BetterVisitor
    • shouldVisitCode

      public boolean shouldVisitCode(org.apache.bcel.classfile.Code obj)
      Description copied from class: BytecodeScanningDetector
      Check see if the Code for this method should be visited.
      Overrides:
      shouldVisitCode in class BytecodeScanningDetector
      Parameters:
      obj - Code attribute
      Returns:
      true if the Code should be visited
    • opcode

      public static int opcode(byte[] code, int offset)
    • visit

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

      public void visit(org.apache.bcel.classfile.Method obj)
      Overrides:
      visit in class BetterVisitor
    • findMethod

      org.apache.bcel.classfile.Method findMethod(org.apache.bcel.classfile.JavaClass clazz, String name, String sig)
    • sawOpcode

      public void sawOpcode(int seen)
      Description copied from class: OpcodeStackDetector

      By default, this method will not be called when stack is TOP. To change this behavior, override #beforeOpcode(int) and change to return true even if stack is TOP.

      see Using FindBugs for Research to learn lattice and what TOP means.

      Specified by:
      sawOpcode in class OpcodeStackDetector
      See Also:
    • check

      private void check(int pos)
    • findHashedClassInSignature

      @CheckForNull @DottedClassName String findHashedClassInSignature(String sig)
    • visit

      public void visit(org.apache.bcel.classfile.Signature obj)
      Overrides:
      visit in class BetterVisitor
    • 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
      Overrides:
      report in class BytecodeScanningDetector