Search in sources :

Example 6 with OpcodeStack

use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.

the class SideEffectConstructor method visitClassContext.

/**
 * overrides the visitor 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;
    }
}
Also used : OpcodeStack(edu.umd.cs.findbugs.OpcodeStack)

Example 7 with OpcodeStack

use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.

the class SillynessPotPourri method visitClassContext.

@Override
public void visitClassContext(ClassContext classContext) {
    try {
        stack = new OpcodeStack();
        lastPCs = new int[4];
        branchTargets = new HashMap<>();
        trimLocations = new HashMap<>();
        isInterface = classContext.getJavaClass().isInterface();
        super.visitClassContext(classContext);
    } finally {
        stack = null;
        lastPCs = null;
        branchTargets = null;
        trimLocations = null;
        staticConstants = null;
    }
}
Also used : OpcodeStack(edu.umd.cs.findbugs.OpcodeStack)

Example 8 with OpcodeStack

use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.

the class SpuriousThreadStates method visitClassContext.

@Override
public void visitClassContext(ClassContext classContext) {
    try {
        stack = new OpcodeStack();
        super.visitClassContext(classContext);
    } finally {
        stack = null;
    }
}
Also used : OpcodeStack(edu.umd.cs.findbugs.OpcodeStack)

Example 9 with OpcodeStack

use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.

the class StackedTryBlocks method visitClassContext.

/**
 * overrides the visitor to reset the opcode stack
 *
 * @param classContext
 *            the currently parsed class
 */
@Override
public void visitClassContext(ClassContext classContext) {
    try {
        if (THROWABLE_CLASS != null) {
            stack = new OpcodeStack();
            super.visitClassContext(classContext);
        }
    } finally {
        stack = null;
    }
}
Also used : OpcodeStack(edu.umd.cs.findbugs.OpcodeStack)

Example 10 with OpcodeStack

use of edu.umd.cs.findbugs.OpcodeStack in project fb-contrib by mebigfatguy.

the class UnrelatedCollectionContents method visitClassContext.

/**
 * implements the visitor to create and destroy the stack and member collections
 *
 * @param classContext
 *            the context object for the currently parsed class
 */
@Override
public void visitClassContext(final ClassContext classContext) {
    try {
        stack = new OpcodeStack();
        memberCollections = new HashMap<>();
        memberSourceLineAnnotations = new HashMap<>();
        super.visitClassContext(classContext);
    } finally {
        stack = null;
        memberCollections = null;
        memberSourceLineAnnotations = null;
    }
}
Also used : OpcodeStack(edu.umd.cs.findbugs.OpcodeStack)

Aggregations

OpcodeStack (edu.umd.cs.findbugs.OpcodeStack)95 JavaClass (org.apache.bcel.classfile.JavaClass)20 BitSet (java.util.BitSet)15 BugInstance (edu.umd.cs.findbugs.BugInstance)7 HashMap (java.util.HashMap)4 Map (java.util.Map)3 Field (org.apache.bcel.classfile.Field)3 StopOpcodeParsingException (com.mebigfatguy.fbcontrib.utils.StopOpcodeParsingException)2 FieldAnnotation (edu.umd.cs.findbugs.FieldAnnotation)2 XField (edu.umd.cs.findbugs.ba.XField)2 AnnotationEntry (org.apache.bcel.classfile.AnnotationEntry)2 Method (org.apache.bcel.classfile.Method)2 ToString (com.mebigfatguy.fbcontrib.utils.ToString)1 ClassDescriptor (edu.umd.cs.findbugs.classfile.ClassDescriptor)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Set (java.util.Set)1 ConstantInteger (org.apache.bcel.classfile.ConstantInteger)1