use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class CloneUsability method visitClassContext.
/**
* overrides the visitor to check for classes that implement Cloneable.
*
* @param classContext
* the context object that holds the JavaClass being parsed
*/
@Override
public void visitClassContext(ClassContext classContext) {
if (cloneClass == null) {
return;
}
try {
cls = classContext.getJavaClass();
if (cls.implementationOf(cloneClass)) {
clsName = cls.getClassName();
stack = new OpcodeStack();
super.visitClassContext(classContext);
}
} catch (ClassNotFoundException cnfe) {
bugReporter.reportMissingClass(cnfe);
} finally {
cls = null;
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class FunctionalInterfaceIssues method visitClassContext.
@Override
public void visitClassContext(ClassContext classContext) {
try {
JavaClass cls = classContext.getJavaClass();
if (cls.getMajor() >= Const.MAJOR_1_8) {
bootstrapAtt = getBootstrapAttribute(cls);
if (bootstrapAtt != null) {
stack = new OpcodeStack();
functionalInterfaceInfo = new HashMap<>();
super.visitClassContext(classContext);
for (Map.Entry<Method, List<FIInfo>> entry : functionalInterfaceInfo.entrySet()) {
for (FIInfo fii : entry.getValue()) {
}
}
}
}
} finally {
functionalInterfaceInfo = null;
bootstrapAtt = null;
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class LocalHangingExecutor method visitClassContext.
/**
* finds ExecutorService objects that don't get a call to the terminating methods, and thus, never appear to be shutdown properly (the threads exist until
* shutdown is called)
*
* @param classContext
* the class context object of the currently parsed java class
*/
@Override
public void visitClassContext(ClassContext classContext) {
localHEDetector.visitClassContext(classContext);
try {
hangingFieldCandidates = new HashMap<>();
exemptExecutors = new HashMap<>();
parseFieldsForHangingCandidates(classContext);
if (!hangingFieldCandidates.isEmpty()) {
stack = new OpcodeStack();
super.visitClassContext(classContext);
reportHangingExecutorFieldBugs();
}
} finally {
stack = null;
hangingFieldCandidates = null;
exemptExecutors = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class IOIssues method visitClassContext.
/**
* implements the visitor to create and tear down the opcode stack
*
* @param clsContext
* the context object of the currently parsed class
*/
@Override
public void visitClassContext(ClassContext clsContext) {
try {
stack = new OpcodeStack();
clsVersion = clsContext.getJavaClass().getMajor();
super.visitClassContext(clsContext);
} finally {
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class CollectStatistics method visitClassContext.
/**
* implements the visitor to collect statistics on this class
*
* @param classContext
* the currently class
*/
@Override
public void visitClassContext(ClassContext classContext) {
try {
JavaClass cls = classContext.getJavaClass();
AnnotationEntry[] annotations = cls.getAnnotationEntries();
classHasAnnotation = !CollectionUtils.isEmpty(annotations);
stack = new OpcodeStack();
selfCallTree = new HashMap<>();
super.visitClassContext(classContext);
performModifyStateClosure(classContext.getJavaClass());
} finally {
stack = null;
selfCallTree = null;
curMethod = null;
}
}
Aggregations