private void addGetEnhancementContractVersionMethod() { // public int getEnhancementContractVersion() BCMethod method = _pc.declareMethod(PRE + "GetEnhancementContractVersion", int.class, null); method.makePublic(); Code code = method.getCode(true); code.constant().setValue(ENHANCER_VERSION); code.ireturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
private void addGetEnhancementContractVersionMethod() { // public int getEnhancementContractVersion() BCMethod method = _pc.declareMethod(PRE + "GetEnhancementContractVersion", int.class, null); method.makePublic(); Code code = method.getCode(true); code.constant().setValue(ENHANCER_VERSION); code.ireturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
private void addGetEnhancementContractVersionMethod() { // public int getEnhancementContractVersion() BCMethod method = _pc.declareMethod(PRE + "GetEnhancementContractVersion", int.class, null); method.makePublic(); Code code = method.getCode(true); code.constant().setValue(ENHANCER_VERSION); code.ireturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
private void addGetEnhancementContractVersionMethod() { // public int getEnhancementContractVersion() BCMethod method = _pc.declareMethod(PRE + "GetEnhancementContractVersion", int.class, null); method.makePublic(); Code code = method.getCode(true); code.constant().setValue(ENHANCER_VERSION); code.ireturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Implement getFieldCount/getObjectCount. */ private void addFieldCount(BCClass bc, int[] types, int objectCount) { BCMethod method = bc.declareMethod("getFieldCount", int.class, null); Code code = method.getCode(true); code.constant().setValue(types.length); code.ireturn(); code.calculateMaxLocals(); code.calculateMaxStack(); method = bc.declareMethod("getObjectCount", int.class, null); code = method.getCode(true); code.constant().setValue(objectCount); code.ireturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Implement getFieldCount/getObjectCount. */ private void addFieldCount(BCClass bc, int[] types, int objectCount) { BCMethod method = bc.declareMethod("getFieldCount", int.class, null); Code code = method.getCode(true); code.constant().setValue(types.length); code.ireturn(); code.calculateMaxLocals(); code.calculateMaxStack(); method = bc.declareMethod("getObjectCount", int.class, null); code = method.getCode(true); code.constant().setValue(objectCount); code.ireturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Implement getFieldCount/getObjectCount. */ private void addFieldCount(BCClass bc, int[] types, int objectCount) { BCMethod method = bc.declareMethod("getFieldCount", int.class, null); Code code = method.getCode(true); code.constant().setValue(types.length); code.ireturn(); code.calculateMaxLocals(); code.calculateMaxStack(); method = bc.declareMethod("getObjectCount", int.class, null); code = method.getCode(true); code.constant().setValue(objectCount); code.ireturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
private void addGetEnhancementContractVersionMethod() { // public int getEnhancementContractVersion() BCMethod method = _pc.declareMethod(PRE + "GetEnhancementContractVersion", int.class, null); method.makePublic(); Code code = method.getCode(true); code.constant().setValue(ENHANCER_VERSION); code.ireturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Implement getFieldCount/getObjectCount. */ private void addFieldCount(BCClass bc, int[] types, int objectCount) { BCMethod method = bc.declareMethod("getFieldCount", int.class, null); Code code = method.getCode(true); code.constant().setValue(types.length); code.ireturn(); code.calculateMaxLocals(); code.calculateMaxStack(); method = bc.declareMethod("getObjectCount", int.class, null); code = method.getCode(true); code.constant().setValue(objectCount); code.ireturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Implement getFieldCount/getObjectCount. */ private void addFieldCount(BCClass bc, int[] types, int objectCount) { BCMethod method = bc.declareMethod("getFieldCount", int.class, null); Code code = method.getCode(true); code.constant().setValue(types.length); code.ireturn(); code.calculateMaxLocals(); code.calculateMaxStack(); method = bc.declareMethod("getObjectCount", int.class, null); code = method.getCode(true); code.constant().setValue(objectCount); code.ireturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
private void addSynchronization(BCClass bc) { BCMethod[] methods = bc.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { if (methods[i].isPublic() && _synchs.contains(methods[i].getName())) methods[i].setSynchronized(true); } // add synchronized isLoaded call. // public synchronized boolean isLoaded (int field) // { // return super.isLoaded (field); // } BCMethod method = bc.declareMethod("isLoaded", boolean.class, new Class[]{ int.class }); method.setSynchronized(true); Code code = method.getCode(true); code.aload().setThis(); code.iload().setParam(0); code.invokespecial().setMethod(AbstractPCData.class, "isLoaded", boolean.class, new Class[]{ int.class }); code.calculateMaxLocals(); code.calculateMaxStack(); code.ireturn(); }
private void addSynchronization(BCClass bc) { BCMethod[] methods = bc.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { if (methods[i].isPublic() && _synchs.contains(methods[i].getName())) methods[i].setSynchronized(true); } // add synchronized isLoaded call. // public synchronized boolean isLoaded (int field) // { // return super.isLoaded (field); // } BCMethod method = bc.declareMethod("isLoaded", boolean.class, new Class[]{ int.class }); method.setSynchronized(true); Code code = method.getCode(true); code.aload().setThis(); code.iload().setParam(0); code.invokespecial().setMethod(AbstractPCData.class, "isLoaded", boolean.class, new Class[]{ int.class }); code.calculateMaxLocals(); code.calculateMaxStack(); code.ireturn(); }
private void addSynchronization(BCClass bc) { BCMethod[] methods = bc.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { if (methods[i].isPublic() && _synchs.contains(methods[i].getName())) methods[i].setSynchronized(true); } // add synchronized isLoaded call. // public synchronized boolean isLoaded (int field) // { // return super.isLoaded (field); // } BCMethod method = bc.declareMethod("isLoaded", boolean.class, new Class[]{ int.class }); method.setSynchronized(true); Code code = method.getCode(true); code.aload().setThis(); code.iload().setParam(0); code.invokespecial().setMethod(AbstractPCData.class, "isLoaded", boolean.class, new Class[]{ int.class }); code.calculateMaxLocals(); code.calculateMaxStack(); code.ireturn(); }
private void addSynchronization(BCClass bc) { BCMethod[] methods = bc.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { if (methods[i].isPublic() && _synchs.contains(methods[i].getName())) methods[i].setSynchronized(true); } // add synchronized isLoaded call. // public synchronized boolean isLoaded (int field) // { // return super.isLoaded (field); // } BCMethod method = bc.declareMethod("isLoaded", boolean.class, new Class[]{ int.class }); method.setSynchronized(true); Code code = method.getCode(true); code.aload().setThis(); code.iload().setParam(0); code.invokespecial().setMethod(AbstractPCData.class, "isLoaded", boolean.class, new Class[]{ int.class }); code.calculateMaxLocals(); code.calculateMaxStack(); code.ireturn(); }
private void addSynchronization(BCClass bc) { BCMethod[] methods = bc.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { if (methods[i].isPublic() && _synchs.contains(methods[i].getName())) methods[i].setSynchronized(true); } // add synchronized isLoaded call. // public synchronized boolean isLoaded (int field) // { // return super.isLoaded (field); // } BCMethod method = bc.declareMethod("isLoaded", boolean.class, new Class[]{ int.class }); method.setSynchronized(true); Code code = method.getCode(true); code.aload().setThis(); code.iload().setParam(0); code.invokespecial().setMethod(AbstractPCData.class, "isLoaded", boolean.class, new Class[]{ int.class }); code.calculateMaxLocals(); code.calculateMaxStack(); code.ireturn(); }
/** * Creates the pcIsDetached() method to determine if an instance * is detached. */ private void addIsDetachedMethod() throws NoSuchMethodException { // public boolean pcIsDetached() BCMethod method = _pc.declareMethod(PRE + "IsDetached", Boolean.class, null); method.makePublic(); Code code = method.getCode(true); boolean needsDefinitiveMethod = writeIsDetachedMethod(code); code.calculateMaxStack(); code.calculateMaxLocals(); if (!needsDefinitiveMethod) return; // private boolean pcIsDetachedStateDefinitive() // return false; // auxilliary enhancers may change the return value of this method // if their specs consider detached state definitive method = _pc.declareMethod(ISDETACHEDSTATEDEFINITIVE, boolean.class, null); method.makePrivate(); code = method.getCode(true); code.constant().setValue(false); code.ireturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Creates the pcIsDetached() method to determine if an instance * is detached. */ private void addIsDetachedMethod() throws NoSuchMethodException { // public boolean pcIsDetached() BCMethod method = _pc.declareMethod(PRE + "IsDetached", Boolean.class, null); method.makePublic(); Code code = method.getCode(true); boolean needsDefinitiveMethod = writeIsDetachedMethod(code); code.calculateMaxStack(); code.calculateMaxLocals(); if (!needsDefinitiveMethod) return; // private boolean pcIsDetachedStateDefinitive() // return false; // auxilliary enhancers may change the return value of this method // if their specs consider detached state definitive method = _pc.declareMethod(ISDETACHEDSTATEDEFINITIVE, boolean.class, null); method.makePrivate(); code = method.getCode(true); code.constant().setValue(false); code.ireturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Creates the pcIsDetached() method to determine if an instance * is detached. */ private void addIsDetachedMethod() throws NoSuchMethodException { // public boolean pcIsDetached() BCMethod method = _pc.declareMethod(PRE + "IsDetached", Boolean.class, null); method.makePublic(); Code code = method.getCode(true); boolean needsDefinitiveMethod = writeIsDetachedMethod(code); code.calculateMaxStack(); code.calculateMaxLocals(); if (!needsDefinitiveMethod) return; // private boolean pcIsDetachedStateDefinitive() // return false; // auxilliary enhancers may change the return value of this method // if their specs consider detached state definitive method = _pc.declareMethod(ISDETACHEDSTATEDEFINITIVE, boolean.class, null); method.makePrivate(); code = method.getCode(true); code.constant().setValue(false); code.ireturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Creates the pcIsDetached() method to determine if an instance * is detached. */ private void addIsDetachedMethod() throws NoSuchMethodException { // public boolean pcIsDetached() BCMethod method = _pc.declareMethod(PRE + "IsDetached", Boolean.class, null); method.makePublic(); Code code = method.getCode(true); boolean needsDefinitiveMethod = writeIsDetachedMethod(code); code.calculateMaxStack(); code.calculateMaxLocals(); if (!needsDefinitiveMethod) return; // private boolean pcIsDetachedStateDefinitive() // return false; // auxilliary enhancers may change the return value of this method // if their specs consider detached state definitive method = _pc.declareMethod(ISDETACHEDSTATEDEFINITIVE, boolean.class, null); method.makePrivate(); code = method.getCode(true); code.constant().setValue(false); code.ireturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Creates the pcIsDetached() method to determine if an instance * is detached. */ private void addIsDetachedMethod() throws NoSuchMethodException { // public boolean pcIsDetached() BCMethod method = _pc.declareMethod(PRE + "IsDetached", Boolean.class, null); method.makePublic(); Code code = method.getCode(true); boolean needsDefinitiveMethod = writeIsDetachedMethod(code); code.calculateMaxStack(); code.calculateMaxLocals(); if (!needsDefinitiveMethod) return; // private boolean pcIsDetachedStateDefinitive() // return false; // auxilliary enhancers may change the return value of this method // if their specs consider detached state definitive method = _pc.declareMethod(ISDETACHEDSTATEDEFINITIVE, boolean.class, null); method.makePrivate(); code = method.getCode(true); code.constant().setValue(false); code.ireturn(); code.calculateMaxStack(); code.calculateMaxLocals(); }