private void init(JavaClass jclass) { ConstantPool cp = jclass.getConstantPool(); int numConstants = cp.getLength(); for (int i = 0; i < numConstants; ++i) { try {
int[] v = new int[cp.getLength() + 1]; out.write(linkPath(t = c.getSourceFileName())); defs.add(t);
for (int i = 0; i < jclass.getConstantPool().getLength(); ++i) { Constant constant = jclass.getConstantPool().getConstant(i); String className = null;
buf.append("compiler version\t" + major + "." + minor + '\n'); buf.append("access flags\t\t" + access_flags + '\n'); buf.append("constant pool\t\t" + constant_pool.getLength() + " entries\n"); buf.append("ACC_SUPER flag\t\t" + isSuper() + "\n");
buf.append("compiler version\t").append(major).append(".").append(minor).append('\n'); buf.append("access flags\t\t").append(super.getAccessFlags()).append('\n'); buf.append("constant pool\t\t").append(constant_pool.getLength()).append(" entries\n"); buf.append("ACC_SUPER flag\t\t").append(isSuper()).append("\n"); if (attributes.length > 0) {
private void init(JavaClass jclass) { ConstantPool cp = jclass.getConstantPool(); int numConstants = cp.getLength(); for (int i = 0; i < numConstants; ++i) { try {
private CPESSC_Visitor(final JavaClass _jc) { jc = _jc; cp = _jc.getConstantPool(); cplen = cp.getLength(); CONST_Class = ConstantClass.class; /* CONST_Fieldref = ConstantFieldref.class; CONST_Methodref = ConstantMethodref.class; CONST_InterfaceMethodref = ConstantInterfaceMethodref.class; */ CONST_String = ConstantString.class; CONST_Integer = ConstantInteger.class; CONST_Float = ConstantFloat.class; CONST_Long = ConstantLong.class; CONST_Double = ConstantDouble.class; CONST_NameAndType = ConstantNameAndType.class; CONST_Utf8 = ConstantUtf8.class; carrier = new DescendingVisitor(_jc, this); carrier.visit(); }
private CPESSC_Visitor(JavaClass _jc){ jc = _jc; cp = _jc.getConstantPool(); cplen = cp.getLength(); CONST_Class = org.apache.bcel.classfile.ConstantClass.class; /* CONST_Fieldref = org.apache.bcel.classfile.ConstantFieldref.class; CONST_Methodref = org.apache.bcel.classfile.ConstantMethodref.class; CONST_InterfaceMethodref = org.apache.bcel.classfile.ConstantInterfaceMethodref.class; */ CONST_String = org.apache.bcel.classfile.ConstantString.class; CONST_Integer = org.apache.bcel.classfile.ConstantInteger.class; CONST_Float = org.apache.bcel.classfile.ConstantFloat.class; CONST_Long = org.apache.bcel.classfile.ConstantLong.class; CONST_Double = org.apache.bcel.classfile.ConstantDouble.class; CONST_NameAndType = org.apache.bcel.classfile.ConstantNameAndType.class; CONST_Utf8 = org.apache.bcel.classfile.ConstantUtf8.class; carrier = new DescendingVisitor(_jc, this); carrier.visit(); }
for (int i = 0; i < jclass.getConstantPool().getLength(); ++i) { Constant constant = jclass.getConstantPool().getConstant(i); String className = null;
/** * implements the visitor to look for classes that reference com.sun.xxx, or org.apache.xerces.xxx classes by looking for class constants in the constant * pool * * @param context * the context object of the currently parsed class */ @Override public void visitClassContext(ClassContext context) { JavaClass cls = context.getJavaClass(); if (!isInternal(cls.getClassName())) { ConstantPool pool = cls.getConstantPool(); int numItems = pool.getLength(); for (int i = 0; i < numItems; i++) { Constant c = pool.getConstant(i); if (c instanceof ConstantClass) { String clsName = ((ConstantClass) c).getBytes(pool); if (isInternal(clsName)) { bugReporter.reportBug( new BugInstance(this, BugType.IICU_INCORRECT_INTERNAL_CLASS_USE.name(), NORMAL_PRIORITY).addClass(cls).addString(clsName)); } } } } }
/** * implements the visitor to look for classes that reference com.sun.xxx, or org.apache.xerces.xxx classes by looking for class Const in the constant pool * * @param context * the context object of the currently parsed class */ @Override public void visitClassContext(ClassContext context) { JavaClass cls = context.getJavaClass(); if (!isInternal(cls.getClassName())) { ConstantPool pool = cls.getConstantPool(); int numItems = pool.getLength(); for (int i = 0; i < numItems; i++) { Constant c = pool.getConstant(i); if (c instanceof ConstantClass) { String clsName = ((ConstantClass) c).getBytes(pool); if (isInternal(clsName)) { bugReporter.reportBug( new BugInstance(this, BugType.IICU_INCORRECT_INTERNAL_CLASS_USE.name(), NORMAL_PRIORITY).addClass(cls).addString(clsName)); } } } } }
public ConstantPool(JavaClass cls) { org.apache.bcel.classfile.ConstantPool cp = cls.getConstantPool(); final int size = cp.getLength(); add(new EmptyEntry(0)); // slot 0