private void modifyConstructors(ClassFile cf) throws CannotCompileException, NotFoundException { if (fieldInitializers == null) return; ConstPool cp = cf.getConstPool(); List list = cf.getMethods(); int n = list.size(); for (int i = 0; i < n; ++i) { MethodInfo minfo = (MethodInfo)list.get(i); if (minfo.isConstructor()) { CodeAttribute codeAttr = minfo.getCodeAttribute(); if (codeAttr != null) try { Bytecode init = new Bytecode(cp, 0, codeAttr.getMaxLocals()); CtClass[] params = Descriptor.getParameterTypes( minfo.getDescriptor(), classPool); int stacksize = makeFieldInitializer(init, params); insertAuxInitializer(codeAttr, init, stacksize); minfo.rebuildStackMapIf6(classPool, cf); } catch (BadBytecode e) { throw new CannotCompileException(e); } } } }
removeConsCall(ca); try { methodInfo.rebuildStackMapIf6(declaring.getClassPool(), declaring.getClassFile2());
private void modifyConstructors(ClassFile cf) throws CannotCompileException, NotFoundException { if (fieldInitializers == null) return; ConstPool cp = cf.getConstPool(); List<MethodInfo> methods = cf.getMethods(); for (MethodInfo minfo:methods) { if (minfo.isConstructor()) { CodeAttribute codeAttr = minfo.getCodeAttribute(); if (codeAttr != null) try { Bytecode init = new Bytecode(cp, 0, codeAttr.getMaxLocals()); CtClass[] params = Descriptor.getParameterTypes( minfo.getDescriptor(), classPool); int stacksize = makeFieldInitializer(init, params); insertAuxInitializer(codeAttr, init, stacksize); minfo.rebuildStackMapIf6(classPool, cf); } catch (BadBytecode e) { throw new CannotCompileException(e); } } } }
methodInfo.setAccessFlags(methodInfo.getAccessFlags() & ~AccessFlag.ABSTRACT); methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2()); declaringClass.rebuildClassFile();
CtClass decl = cb.getDeclaringClass(); cb.getMethodInfo2() .rebuildStackMapIf6(decl.getClassPool(), decl.getClassFile2()); return cb;
removeConsCall(ca); try { methodInfo.rebuildStackMapIf6(declaring.getClassPool(), declaring.getClassFile2());
methodInfo.setAccessFlags(methodInfo.getAccessFlags() & ~AccessFlag.ABSTRACT); methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2()); declaringClass.rebuildClassFile();
CtClass decl = cb.getDeclaringClass(); cb.getMethodInfo2() .rebuildStackMapIf6(decl.getClassPool(), decl.getClassFile2()); return cb;
try { if (edited) minfo.rebuildStackMapIf6(clazz.getClassPool(), clazz.getClassFile2());
minfo.rebuildStackMapIf6(clazz.getClassPool(), clazz.getClassFile2());
m.rebuildStackMapIf6(classPool, cf);
int pos = iterator.insertEx(b.get()); iterator.insert(b.getExceptionTable(), pos); methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2());
try { if (edited) minfo.rebuildStackMapIf6(clazz.getClassPool(), clazz.getClassFile2());
iterator.insert(b.getExceptionTable(), pos); if (rebuild) methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2());
m.rebuildStackMapIf6(classPool, cf);
methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2()); return lineNum;
int pos = iterator.insertEx(b.get()); iterator.insert(b.getExceptionTable(), pos); methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2());
cp.addClassInfo(exceptionType)); iterator.append(b.getExceptionTable(), pos); methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2());
iterator.insert(b.getExceptionTable(), pos); if (rebuild) methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2());
methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2());