/** * Used to identify if a method is a bridge method. * * @param b true to set bridge, false otherwise */ public Modifiers toBridge(boolean b) { return convert(toBridge(mBitmask, b)); }
/** * Used to identify if a method is a bridge method. * * @param b true to set bridge, false otherwise */ public Modifiers toBridge(boolean b) { return convert(toBridge(mBitmask, b)); }
/** * Add a prepare bridge method to the classfile for the given type. * * @param cf file to which to add the prepare bridge * @param leaf leaf class * @param returnClass type returned from generated bridge method * @since 1.2 */ private static void definePrepareBridge(ClassFile cf, Class leaf, Class returnClass) { TypeDesc returnType = TypeDesc.forClass(returnClass); if (isPublicMethodFinal(leaf, PREPARE_METHOD_NAME, returnType, null)) { // Cannot override. return; } MethodInfo mi = cf.addMethod(Modifiers.PUBLIC.toBridge(true), PREPARE_METHOD_NAME, returnType, null); CodeBuilder b = new CodeBuilder(mi); b.loadThis(); b.invokeVirtual(PREPARE_METHOD_NAME, cf.getType(), null); b.returnValue(returnType); }
/** * Add a copy bridge method to the classfile for the given type. This is * needed to allow the genericised class make a copy itself -- which will * be erased to the base type -- and return it as the correct type. * * @param cf file to which to add the copy bridge * @param leaf leaf class * @param returnClass type returned from generated bridge method */ private static void defineCopyBridge(ClassFile cf, Class leaf, Class returnClass) { TypeDesc returnType = TypeDesc.forClass(returnClass); if (isPublicMethodFinal(leaf, COPY_METHOD_NAME, returnType, null)) { // Cannot override. return; } MethodInfo mi = cf.addMethod(Modifiers.PUBLIC.toBridge(true), COPY_METHOD_NAME, returnType, null); CodeBuilder b = new CodeBuilder(mi); b.loadThis(); b.invokeVirtual(COPY_METHOD_NAME, cf.getType(), null); b.returnValue(returnType); }
/** * Add a prepare bridge method to the classfile for the given type. * * @param cf file to which to add the prepare bridge * @param leaf leaf class * @param returnClass type returned from generated bridge method * @since 1.2 */ private static void definePrepareBridge(ClassFile cf, Class leaf, Class returnClass) { TypeDesc returnType = TypeDesc.forClass(returnClass); if (isPublicMethodFinal(leaf, PREPARE_METHOD_NAME, returnType, null)) { // Cannot override. return; } MethodInfo mi = cf.addMethod(Modifiers.PUBLIC.toBridge(true), PREPARE_METHOD_NAME, returnType, null); CodeBuilder b = new CodeBuilder(mi); b.loadThis(); b.invokeVirtual(PREPARE_METHOD_NAME, cf.getType(), null); b.returnValue(returnType); }
/** * Add a copy bridge method to the classfile for the given type. This is * needed to allow the genericised class make a copy itself -- which will * be erased to the base type -- and return it as the correct type. * * @param cf file to which to add the copy bridge * @param leaf leaf class * @param returnClass type returned from generated bridge method */ private static void defineCopyBridge(ClassFile cf, Class leaf, Class returnClass) { TypeDesc returnType = TypeDesc.forClass(returnClass); if (isPublicMethodFinal(leaf, COPY_METHOD_NAME, returnType, null)) { // Cannot override. return; } MethodInfo mi = cf.addMethod(Modifiers.PUBLIC.toBridge(true), COPY_METHOD_NAME, returnType, null); CodeBuilder b = new CodeBuilder(mi); b.loadThis(); b.invokeVirtual(COPY_METHOD_NAME, cf.getType(), null); b.returnValue(returnType); }
(Modifiers.PUBLIC.toBridge(true), property.getReadMethodName(), desc, null);
(Modifiers.PUBLIC.toBridge(true), property.getReadMethodName(), desc, null);