private void addGetIDOwningClass() throws NoSuchMethodException { BCMethod method = _pc.declareMethod(PRE + "GetIDOwningClass", Class.class, null); Code code = method.getCode(true); code.classconstant().setClass(getType(_meta)); code.areturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
private void addGetIDOwningClass() throws NoSuchMethodException { BCMethod method = _pc.declareMethod(PRE + "GetIDOwningClass", Class.class, null); Code code = method.getCode(true); code.classconstant().setClass(getType(_meta)); code.areturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
private void addGetIDOwningClass() throws NoSuchMethodException { BCMethod method = _pc.declareMethod(PRE + "GetIDOwningClass", Class.class, null); Code code = method.getCode(true); code.classconstant().setClass(getType(_meta)); code.areturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
private void addGetIDOwningClass() throws NoSuchMethodException { BCMethod method = _pc.declareMethod(PRE + "GetIDOwningClass", Class.class, null); Code code = method.getCode(true); code.classconstant().setClass(getType(_meta)); code.areturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
private void addGetData(BCClass bc) { // return getObjectField(i); BCMethod method = bc.declareMethod("getData", Object.class, new Class[]{ int.class }); Code code = method.getCode(true); code.aload().setThis(); code.iload().setParam(0); code.invokevirtual().setMethod("getObject", Object.class, new Class[]{ int.class }); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
private void addGetData(BCClass bc) { // return getObjectField(i); BCMethod method = bc.declareMethod("getData", Object.class, new Class[]{ int.class }); Code code = method.getCode(true); code.aload().setThis(); code.iload().setParam(0); code.invokevirtual().setMethod("getObject", Object.class, new Class[]{ int.class }); 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 addGetData(BCClass bc) { // return getObjectField(i); BCMethod method = bc.declareMethod("getData", Object.class, new Class[]{ int.class }); Code code = method.getCode(true); code.aload().setThis(); code.iload().setParam(0); code.invokevirtual().setMethod("getObject", Object.class, new Class[]{ int.class }); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
private void addGetData(BCClass bc) { // return getObjectField(i); BCMethod method = bc.declareMethod("getData", Object.class, new Class[]{ int.class }); Code code = method.getCode(true); code.aload().setThis(); code.iload().setParam(0); code.invokevirtual().setMethod("getObject", Object.class, new Class[]{ int.class }); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
private void addGetData(BCClass bc) { // return getObjectField(i); BCMethod method = bc.declareMethod("getData", Object.class, new Class[]{ int.class }); Code code = method.getCode(true); code.aload().setThis(); code.iload().setParam(0); code.invokevirtual().setMethod("getObject", Object.class, new Class[]{ int.class }); 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(); }
/** * Add a writeReplace implementation that serializes to a non-proxy type * unless detached and this is a build-time generated class. */ private void addWriteReplaceMethod(BCClass bc, boolean runtime) { BCMethod m = bc.declareMethod("writeReplace", Object.class, null); m.makeProtected(); m.getExceptions(true).addException(ObjectStreamException.class); Code code = m.getCode(true); code.aload().setThis(); code.constant().setValue(!runtime); code.invokestatic().setMethod(Proxies.class, "writeReplace", Object.class, new Class[] { Proxy.class, boolean.class }); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Add a writeReplace implementation that serializes to a non-proxy type * unless detached and this is a build-time generated class. */ private void addWriteReplaceMethod(BCClass bc, boolean runtime) { BCMethod m = bc.declareMethod("writeReplace", Object.class, null); m.makeProtected(); m.getExceptions(true).addException(ObjectStreamException.class); Code code = m.getCode(true); code.aload().setThis(); code.constant().setValue(!runtime); code.invokestatic().setMethod(Proxies.class, "writeReplace", Object.class, new Class[] { Proxy.class, boolean.class }); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Add a writeReplace implementation that serializes to a non-proxy type * unless detached and this is a build-time generated class. */ private void addWriteReplaceMethod(BCClass bc, boolean runtime) { BCMethod m = bc.declareMethod("writeReplace", Object.class, null); m.makeProtected(); m.getExceptions(true).addException(ObjectStreamException.class); Code code = m.getCode(true); code.aload().setThis(); code.constant().setValue(!runtime); code.invokestatic().setMethod(Proxies.class, "writeReplace", Object.class, new Class[] { Proxy.class, boolean.class }); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Add a writeReplace implementation that serializes to a non-proxy type * unless detached and this is a build-time generated class. */ private void addWriteReplaceMethod(BCClass bc, boolean runtime) { BCMethod m = bc.declareMethod("writeReplace", Object.class, null); m.makeProtected(); m.getExceptions(true).addException(ObjectStreamException.class); Code code = m.getCode(true); code.aload().setThis(); code.constant().setValue(!runtime); code.invokestatic().setMethod(Proxies.class, "writeReplace", Object.class, new Class[] { Proxy.class, boolean.class }); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Add a writeReplace implementation that serializes to a non-proxy type * unless detached and this is a build-time generated class. */ private void addWriteReplaceMethod(BCClass bc, boolean runtime) { BCMethod m = bc.declareMethod("writeReplace", Object.class, null); m.makeProtected(); m.getExceptions(true).addException(ObjectStreamException.class); Code code = m.getCode(true); code.aload().setThis(); code.constant().setValue(!runtime); code.invokestatic().setMethod(Proxies.class, "writeReplace", Object.class, new Class[] { Proxy.class, boolean.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(); }