Package edu.umd.cs.findbugs.detect
Class FindNakedNotify
- java.lang.Object
-
- All Implemented Interfaces:
Detector,Priorities,StatelessDetector,java.lang.Cloneable,org.apache.bcel.classfile.Visitor
public class FindNakedNotify extends BytecodeScanningDetector implements StatelessDetector
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classFindNakedNotify.Stage
-
Field Summary
Fields Modifier and Type Field Description private BugReporterbugReporterprivate intnotifyPCprivate FindNakedNotify.Stagestageprivate booleanstateUpdatedBeforeSyncTrue when this method performed a visible state update after the previous synchronized region (or method entry) and before the currentmonitorenter.(package private) booleansynchronizedMethod-
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 FindNakedNotify(BugReporter bugReporter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidabandonSyncRegion()private static booleanisWaitOrNotifyName(java.lang.String name)private voidnotePossibleStateUpdate(int seen)Remember updates that can make a following notify meaningful even when they occur outside the synchronized block (issue #3786).private voidreportIfNakedNotify()voidsawOpcode(int seen)voidvisit(org.apache.bcel.classfile.Code obj)voidvisit(org.apache.bcel.classfile.Method obj)-
Methods inherited from class edu.umd.cs.findbugs.BytecodeScanningDetector
getClassContext, report, shouldVisitCode, visitClassContext
-
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, getRefFieldIsStatic, getRegisterOperand, getSigConstantOperand, getStringConstantOperand, getSwitchLabels, getSwitchOffsets, getXClassOperand, getXFieldOperand, getXMethodOperand, isBranch, isIf, isMethodCall, isRegisterLoad, isRegisterStore, isRegisterStore, isReturn, isShift, isSwitch, isWideOpcode, normalizeNullComparison, printOpCode, sawBranchTo, sawClass, sawDouble, sawField, sawFloat, sawIMethod, sawInt, sawLong, sawMethod, sawRegister, sawString
-
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, 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, visitAfter, visitAfter, visitAnnotationDefault, visitAnnotationEntry, visitBootstrapMethods, visitCode, 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, visitCodeException, visitConstantClass, visitConstantDouble, visitConstantFieldref, visitConstantFloat, visitConstantInteger, visitConstantInterfaceMethodref, visitConstantLong, visitConstantMethodref, visitConstantNameAndType, visitConstantString, visitConstantUtf8, visitConstantValue, visitDeprecated, visitExceptionTable, visitField, visitInnerClass, visitLineNumber, visitLocalVariable, visitLocalVariableTypeTable, visitMethod, 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, visitPermittedSubclasses, visitRecord, visitRecordComponent, visitStackMapType
-
-
-
-
Field Detail
-
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 currentmonitorenter. Volatile field stores and ordinary method calls count; plain non-volatile field stores do not (seeNakedWait).
-
-
Constructor Detail
-
FindNakedNotify
public FindNakedNotify(BugReporter bugReporter)
-
-
Method Detail
-
visit
public void visit(org.apache.bcel.classfile.Method obj)
- Overrides:
visitin classBetterVisitor
-
visit
public void visit(org.apache.bcel.classfile.Code obj)
- Overrides:
visitin classDismantleBytecode
-
sawOpcode
public void sawOpcode(int seen)
- Overrides:
sawOpcodein classDismantleBytecode
-
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(java.lang.String name)
-
reportIfNakedNotify
private void reportIfNakedNotify()
-
abandonSyncRegion
private void abandonSyncRegion()
-
-