void read(Instruction other) { super.read(other); setType(((ClassInstruction) other).getTypeName()); }
void read(Instruction other) { super.read(other); setType(((ClassInstruction) other).getTypeName()); }
/** * Throw an exception of the given type. */ protected Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Helper method to add the code necessary to throw the given * exception type, sans message. */ private Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Throw an exception of the given type. */ protected Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Helper method to add the code necessary to throw the given * exception type, sans message. */ private Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Helper method to add the code necessary to throw the given * exception type, sans message. */ private Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Throw an exception of the given type. */ protected Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Helper method to add the code necessary to throw the given * exception type, sans message. */ private Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Throw an exception of the given type. */ protected Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Helper method to add the code necessary to throw the given * exception type, sans message. */ private Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Throw an exception of the given type. */ protected Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Implement the newInstance method. */ private void addFactoryMethod(BCClass bc) { BCMethod method = bc.declareMethod("newInstance", DynamicStorage.class, null); Code code = method.getCode(true); code.anew().setType(bc); code.dup(); code.invokespecial().setMethod(bc.getName(), "<init>", "void", null); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Implement the newInstance method. */ private void addFactoryMethod(BCClass bc) { BCMethod method = bc.declareMethod("newInstance", DynamicStorage.class, null); Code code = method.getCode(true); code.anew().setType(bc); code.dup(); code.invokespecial().setMethod(bc.getName(), "<init>", "void", null); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Implement the newInstance method. */ private void addFactoryMethod(BCClass bc) { BCMethod method = bc.declareMethod("newInstance", DynamicStorage.class, null); Code code = method.getCode(true); code.anew().setType(bc); code.dup(); code.invokespecial().setMethod(bc.getName(), "<init>", "void", null); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Implement the newInstance method. */ private void addFactoryMethod(BCClass bc) { BCMethod method = bc.declareMethod("newInstance", DynamicStorage.class, null); Code code = method.getCode(true); code.anew().setType(bc); code.dup(); code.invokespecial().setMethod(bc.getName(), "<init>", "void", null); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Implement the newInstance method. */ private void addFactoryMethod(BCClass bc) { BCMethod method = bc.declareMethod("newInstance", DynamicStorage.class, null); Code code = method.getCode(true); code.anew().setType(bc); code.dup(); code.invokespecial().setMethod(bc.getName(), "<init>", "void", null); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
private void replaceNewEmbeddedPCData(BCClass bc) { BCMethod meth = bc.declareMethod("newEmbeddedPCData", AbstractPCData.class, new Class[]{ OpenJPAStateManager.class }); Code code = meth.getCode(true); // return new DataCachePCDataImpl(sm.getObjectId(), sm.getMetaData()); code.anew().setType(DataCachePCDataImpl.class); code.dup(); code.aload().setParam(0); code.invokeinterface().setMethod(OpenJPAStateManager.class, "getId", Object.class, null); code.aload().setParam(0); code.invokeinterface().setMethod(OpenJPAStateManager.class, "getMetaData", ClassMetaData.class, null); code.invokespecial().setMethod(DataCachePCDataImpl.class, "<init>", void.class, new Class[] { Object.class, ClassMetaData.class }); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
private void replaceNewEmbeddedPCData(BCClass bc) { BCMethod meth = bc.declareMethod("newEmbeddedPCData", AbstractPCData.class, new Class[]{ OpenJPAStateManager.class }); Code code = meth.getCode(true); // return new DataCachePCDataImpl(sm.getObjectId(), sm.getMetaData()); code.anew().setType(DataCachePCDataImpl.class); code.dup(); code.aload().setParam(0); code.invokeinterface().setMethod(OpenJPAStateManager.class, "getId", Object.class, null); code.aload().setParam(0); code.invokeinterface().setMethod(OpenJPAStateManager.class, "getMetaData", ClassMetaData.class, null); code.invokespecial().setMethod(DataCachePCDataImpl.class, "<init>", void.class, new Class[] { Object.class, ClassMetaData.class }); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Enhance constructor to initialize fields */ private void enhanceConstructor(BCClass bc) { BCMethod cons = bc.getDeclaredMethod("<init>", (String[]) null); Code code = cons.getCode(false); code.afterLast(); code.previous(); // private BitSet loaded = new BitSet(); BCField loaded = addBeanField(bc, "loaded", BitSet.class); loaded.setFinal(true); code.aload().setThis(); code.anew().setType(BitSet.class); code.dup(); code.constant().setValue(bc.getFields().length); code.invokespecial().setMethod(BitSet.class, "<init>", void.class, new Class[]{ int.class }); code.putfield().setField(loaded); code.calculateMaxStack(); code.calculateMaxLocals(); }