Class FindNakedNotify

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

public class FindNakedNotify extends BytecodeScanningDetector implements StatelessDetector
  • Field Details

    • stage

      private FindNakedNotify.Stage stage
    • bugReporter

      private final BugReporter bugReporter
    • synchronizedMethod

      boolean synchronizedMethod
    • notifyPC

      private int notifyPC
    • stateUpdatedBeforeSync

      private boolean stateUpdatedBeforeSync
      True when this method performed a visible state update after the previous synchronized region (or method entry) and before the current monitorenter. Volatile field stores and ordinary method calls count; plain non-volatile field stores do not (see NakedWait).
  • Constructor Details

    • FindNakedNotify

      public FindNakedNotify(BugReporter bugReporter)
  • Method Details

    • visit

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

      public void visit(org.apache.bcel.classfile.Code obj)
      Overrides:
      visit in class DismantleBytecode
    • sawOpcode

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

      private void notePossibleStateUpdate(int seen)
      Remember updates that can make a following notify meaningful even when they occur outside the synchronized block (issue #3786).
    • isWaitOrNotifyName

      private static boolean isWaitOrNotifyName(String name)
    • reportIfNakedNotify

      private void reportIfNakedNotify()
    • abandonSyncRegion

      private void abandonSyncRegion()