use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class NeedlessMemberCollectionSynchronization method visitClassContext.
/**
* implements the visitor to clear the collectionFields and stack and to report collections that remain unmodified out of clinit or init
*
* @param classContext
* the context object of the currently parsed class
*/
@Override
public void visitClassContext(ClassContext classContext) {
try {
if ((collectionClass != null) && (mapClass != null)) {
collectionFields = new HashMap<>();
aliases = new HashMap<>();
stack = new OpcodeStack();
JavaClass cls = classContext.getJavaClass();
className = cls.getClassName();
super.visitClassContext(classContext);
for (FieldInfo fi : collectionFields.values()) {
if (fi.isSynchronized()) {
bugReporter.reportBug(new BugInstance(this, BugType.NMCS_NEEDLESS_MEMBER_COLLECTION_SYNCHRONIZATION.name(), NORMAL_PRIORITY).addClass(this).addField(fi.getFieldAnnotation()));
}
}
}
} finally {
collectionFields = null;
aliases = null;
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class NonOwnedSynchronization method visitClassContext.
/**
* implements the visitor to set and clear the stack and priorities
*/
@Override
public void visitClassContext(ClassContext classContext) {
try {
stack = new OpcodeStack();
regPriorities = new HashMap<>();
super.visitClassContext(classContext);
} finally {
stack = null;
regPriorities = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class NonProductiveMethodCall method visitClassContext.
/**
* implements the visitor to set and clear the stack
*/
@Override
public void visitClassContext(ClassContext classContext) {
try {
stack = new OpcodeStack();
super.visitClassContext(classContext);
} finally {
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class UnnecessaryStoreBeforeReturn method visitClassContext.
/**
* implements the visitor to create and clear the branchTargets
*
* @param classContext
* the context object for the currently parsed class
*/
@Override
public void visitClassContext(ClassContext classContext) {
try {
branchTargets = new BitSet();
catchTargets = new BitSet();
stack = new OpcodeStack();
super.visitClassContext(classContext);
} finally {
branchTargets = null;
catchTargets = null;
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class UnrelatedReturnValues method visitClassContext.
/**
* implements the visitor to create and destroy the stack and return types
*
* @param classContext
* the context object of the currently parsed class
*/
@Override
public void visitClassContext(ClassContext classContext) {
try {
currentClass = classContext.getJavaClass();
stack = new OpcodeStack();
returnTypes = new HashMap<>();
super.visitClassContext(classContext);
} finally {
currentClass = null;
stack = null;
returnTypes = null;
}
}
Aggregations