Search in sources :

Example 21 with Constant

use of org.apache.bcel.classfile.Constant in project fb-contrib by mebigfatguy.

the class FindClassCircularDependencies method processLoadConstant.

private void processLoadConstant() {
    Constant c = getConstantRefOperand();
    if (c instanceof ConstantClass) {
        String refClsName = normalizeArrayClass(getClassConstantOperand().replace('/', '.'));
        if (!refClsName.equals(className)) {
            Set<String> dependencies = getDependenciesForClass(className);
            dependencies.add(refClsName);
        }
    }
}
Also used : Constant(org.apache.bcel.classfile.Constant) ToString(com.mebigfatguy.fbcontrib.utils.ToString) ConstantClass(org.apache.bcel.classfile.ConstantClass)

Aggregations

Constant (org.apache.bcel.classfile.Constant)21 ConstantPool (org.apache.bcel.classfile.ConstantPool)7 ConstantString (org.apache.bcel.classfile.ConstantString)7 ConstantClass (org.apache.bcel.classfile.ConstantClass)6 BugInstance (edu.umd.cs.findbugs.BugInstance)5 ToString (com.mebigfatguy.fbcontrib.utils.ToString)4 ConstantPoolGen (org.apache.bcel.generic.ConstantPoolGen)4 OpcodeStack (edu.umd.cs.findbugs.OpcodeStack)3 ArrayList (java.util.ArrayList)3 Iterator (java.util.Iterator)3 ConstantNameAndType (org.apache.bcel.classfile.ConstantNameAndType)3 ConstantUtf8 (org.apache.bcel.classfile.ConstantUtf8)3 Method (org.apache.bcel.classfile.Method)3 CPInstruction (org.apache.bcel.generic.CPInstruction)3 InstructionHandle (org.apache.bcel.generic.InstructionHandle)3 InstructionList (org.apache.bcel.generic.InstructionList)3 InstructionFinder (org.apache.bcel.util.InstructionFinder)3 HashSet (java.util.HashSet)2 Set (java.util.Set)2 Attribute (org.apache.bcel.classfile.Attribute)2