use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class OverlyConcreteParameter method visitClassContext.
/**
* implements the visitor to collect classes that constrains this class (super classes/interfaces) and to reset the opcode stack
*
* @param classContext
* the currently parse class
*/
@Override
public void visitClassContext(ClassContext classContext) {
try {
cls = classContext.getJavaClass();
if (!isaConversionClass(cls)) {
JavaClass[] infs = cls.getAllInterfaces();
JavaClass[] sups = cls.getSuperClasses();
constrainingClasses = new JavaClass[infs.length + sups.length];
System.arraycopy(infs, 0, constrainingClasses, 0, infs.length);
System.arraycopy(sups, 0, constrainingClasses, infs.length, sups.length);
parameterDefiners = new HashMap<>();
usedParameters = new BitSet();
stack = new OpcodeStack();
super.visitClassContext(classContext);
}
} catch (ClassNotFoundException cnfe) {
bugReporter.reportMissingClass(cnfe);
} finally {
constrainingClasses = null;
parameterDefiners = null;
usedParameters = null;
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class SuboptimalExpressionOrder method visitClassContext.
/**
* overrides the visitor to setup the opcode stack
*
* @param clsContext
* the context object of the currently parse class
*/
@Override
public void visitClassContext(ClassContext clsContext) {
try {
stack = new OpcodeStack();
super.visitClassContext(clsContext);
} finally {
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class SuspiciousCloneAlgorithm method visitClassContext.
/**
* override the visitor to look for classes that implement Cloneable
*
* @param classContext
* the context object of the class to be checked
*/
@Override
public void visitClassContext(ClassContext classContext) {
if (cloneableClass == null) {
return;
}
try {
JavaClass cls = classContext.getJavaClass();
if (cls.implementationOf(cloneableClass)) {
stack = new OpcodeStack();
super.visitClassContext(classContext);
}
} catch (ClassNotFoundException cnfe) {
bugReporter.reportMissingClass(cnfe);
} finally {
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class MethodInfo method visitClassContext.
/**
* implements the visitor to actually iterate twice over this class, once for compareTo and once for compare.
*
* @param classContext
* the currently parsed class
*/
@Override
public void visitClassContext(ClassContext classContext) {
try {
JavaClass cls = classContext.getJavaClass();
for (CompareSpec entry : compareClasses) {
if (cls.implementationOf(entry.getCompareClass())) {
methodInfo = entry.getMethodInfo();
stack = new OpcodeStack();
super.visitClassContext(classContext);
break;
}
}
} catch (ClassNotFoundException cnfe) {
bugReporter.reportMissingClass(cnfe);
} finally {
methodInfo = null;
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class PossibleConstantAllocationInLoop method visitClassContext.
@Override
public void visitClassContext(ClassContext classContext) {
try {
stack = new OpcodeStack();
allocations = new HashMap<>();
storedAllocations = new HashMap<>();
switchInfos = new ArrayList<>();
super.visitClassContext(classContext);
} finally {
stack = null;
allocations = null;
storedAllocations = null;
switchInfos = null;
}
}
Aggregations