use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class CharsetIssues method visitClassContext.
/**
* implements the visitor to make sure the class is at least 1.4, and if so continues, reseting the opcode stack
*
* @param classContext
* the currently parsed java class
*/
@Override
public void visitClassContext(ClassContext classContext) {
try {
classVersion = classContext.getJavaClass().getMajor();
if (classVersion >= Const.MAJOR_1_4) {
stack = new OpcodeStack();
super.visitClassContext(classContext);
}
} finally {
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class InefficientStringBuffering method visitClassContext.
/**
* implements the visitor to create an clear the stack
*
* @param classContext
* the context object of the currently parsed class
*/
@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 JPAIssues method visitClassContext.
/**
* implements the visitor to find @Entity classes that have both generated @Ids and have implemented hashCode/equals. Also looks for eager one to many join
* fetches as that leads to 1+n queries.
*
* @param clsContext
* the context object of the currently parsed class
*/
@Override
public void visitClassContext(ClassContext clsContext) {
try {
cls = clsContext.getJavaClass();
catalogClass(cls);
if (isEntity) {
if (hasHCEquals && hasId && hasGeneratedValue) {
bugReporter.reportBug(new BugInstance(this, BugType.JPAI_HC_EQUALS_ON_MANAGED_ENTITY.name(), LOW_PRIORITY).addClass(cls));
}
if (hasEagerOneToMany && !hasFetch) {
bugReporter.reportBug(new BugInstance(this, BugType.JPAI_INEFFICIENT_EAGER_FETCH.name(), LOW_PRIORITY).addClass(cls));
}
}
if (!transactionalMethods.isEmpty()) {
stack = new OpcodeStack();
super.visitClassContext(clsContext);
}
} finally {
transactionalMethods = null;
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class ListUsageIssues method visitClassContext.
@Override
public void visitClassContext(ClassContext classContext) {
try {
stack = new OpcodeStack();
clsVersion = classContext.getJavaClass().getMajor();
super.visitClassContext(classContext);
} finally {
stack = null;
}
}
use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.
the class ImproperPropertiesUse method visitClassContext.
/**
* implements the listener to set up and tear down the opcode stack
*
* @param classContext
* the context object of the currently parsed class
*/
@Override
public void visitClassContext(ClassContext classContext) {
try {
stack = new OpcodeStack();
super.visitClassContext(classContext);
} finally {
stack = null;
}
}
Aggregations