Class PublicSemaphores

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

public class PublicSemaphores extends BytecodeScanningDetector implements StatelessDetector
finds public classes that use 'this' as a semaphore, which can cause conflicts if clients of this class use an instance of this class as their own synchronization point. Frankly, Just calling synchronized on this, or defining synchronized methods is bad, but since that is so prevalent, don't warn on that.
  • Field Details

    • SEEN_NOTHING

      private static final int SEEN_NOTHING
      See Also:
    • SEEN_ALOAD_0

      private static final int SEEN_ALOAD_0
      See Also:
    • bugReporter

      private final BugReporter bugReporter
    • state

      private int state
    • alreadyReported

      private boolean alreadyReported
  • Constructor Details

    • PublicSemaphores

      public PublicSemaphores(BugReporter bugReporter)
  • Method Details