Examples of addMethodrefInfo()


Examples of javassist.bytecode.ConstPool.addMethodrefInfo()

                        // if we have not already stored a reference to our new
                        // method in the const pool
                        if (newCallLocation == null) {
                            methodReflectionLocation = pool.addClassInfo("org.fakereplace.reflection.MethodReflection");
                            int nt = pool.addNameAndTypeInfo("fakeCallRequired", "(Ljava/lang/reflect/Method;)Z");
                            fakeCallRequiredLocation = pool.addMethodrefInfo(methodReflectionLocation, nt);
                            newCallLocation = pool.addNameAndTypeInfo(METHOD_NAME, REPLACED_METHOD_DESCRIPTOR);
                        }
                    }
                }
            }
View Full Code Here

Examples of javassist.bytecode.ConstPool.addMethodrefInfo()

                                // we have not added the new class reference or
                                // the new call location to the class pool yet
                                int classIndex = pool.getMethodrefClass(i);

                                int newNameAndType = pool.addNameAndTypeInfo("<init>", Constants.ADDED_CONSTRUCTOR_DESCRIPTOR);
                                newCallLocation = pool.addMethodrefInfo(classIndex, newNameAndType);
                            }
                            break;
                        }

                    }
View Full Code Here

Examples of javassist.bytecode.ConstPool.addMethodrefInfo()

                                    newCpLoc = pool.addClassInfo(file.getName());
                                }
                                newClassPoolLocations.put(data, newCpLoc);
                                int newNameAndType = pool.addNameAndTypeInfo(data.getNewMethodName(), data.getNewStaticMethodDesc());
                                newCallLocations.put(data, pool.addMethodrefInfo(newCpLoc, newNameAndType));

                            }
                            break;
                        }
View Full Code Here

Examples of javassist.bytecode.ConstPool.addMethodrefInfo()

              fieldName,
              methodName
          );

          if ( op == Opcode.GETFIELD ) {
            final int readMethodIndex = constPool.addMethodrefInfo(
                constPool.getThisClassInfo(),
                attributeDescriptor.getReader().getName(),
                attributeDescriptor.getReader().getSignature()
            );
            itr.writeByte( Opcode.INVOKESPECIAL, index );
View Full Code Here

Examples of javassist.bytecode.ConstPool.addMethodrefInfo()

            );
            itr.writeByte( Opcode.INVOKESPECIAL, index );
            itr.write16bit( readMethodIndex, index+1 );
          }
          else {
            final int writeMethodIndex = constPool.addMethodrefInfo(
                constPool.getThisClassInfo(),
                attributeDescriptor.getWriter().getName(),
                attributeDescriptor.getWriter().getSignature()
            );
            itr.writeByte( Opcode.INVOKESPECIAL, index );
View Full Code Here

Examples of javassist.bytecode.ConstPool.addMethodrefInfo()

              fieldName,
              methodName
          );

          if ( op == Opcode.GETFIELD ) {
            int read_method_index = constPool.addMethodrefInfo(
                constPool.getThisClassInfo(),
                attributeDescriptor.getReader().getName(),
                attributeDescriptor.getReader().getSignature()
            );
            itr.writeByte( Opcode.INVOKESPECIAL, index );
View Full Code Here

Examples of javassist.bytecode.ConstPool.addMethodrefInfo()

            );
            itr.writeByte( Opcode.INVOKESPECIAL, index );
            itr.write16bit( read_method_index, index+1 );
          }
          else {
            int write_method_index = constPool.addMethodrefInfo(
                constPool.getThisClassInfo(),
                attributeDescriptor.getWriter().getName(),
                attributeDescriptor.getWriter().getSignature()
            );
            itr.writeByte( Opcode.INVOKESPECIAL, index );
View Full Code Here

Examples of javassist.bytecode.ConstPool.addMethodrefInfo()

    if ((!classfile.getName().equals(className))
        || (!readableFields.containsKey(fieldName))) {
      return pos;
    }
    String desc = "()" + (String) readableFields.get(fieldName);
    int read_method_index = cp.addMethodrefInfo(cp.getThisClassInfo(),
                                                EACH_READ_METHOD_PREFIX + fieldName, desc);
    iter.writeByte(Opcode.INVOKEVIRTUAL, pos);
    iter.write16bit(read_method_index, pos + 1);
    return pos;
  }
View Full Code Here

Examples of javassist.bytecode.ConstPool.addMethodrefInfo()

    if ((!classfile.getName().equals(className))
        || (!writableFields.containsKey(fieldName))) {
      return pos;
    }
    String desc = "(" + (String) writableFields.get(fieldName) + ")V";
    int write_method_index = cp.addMethodrefInfo(cp.getThisClassInfo(),
                                                 EACH_WRITE_METHOD_PREFIX + fieldName, desc);
    iter.writeByte(Opcode.INVOKEVIRTUAL, pos);
    iter.write16bit(write_method_index, pos + 1);
    return pos;
  }
View Full Code Here

Examples of javassist.bytecode.ConstPool.addMethodrefInfo()

              fieldName,
              methodName
          );

          if ( op == Opcode.GETFIELD ) {
            final int readMethodIndex = constPool.addMethodrefInfo(
                constPool.getThisClassInfo(),
                attributeDescriptor.getReader().getName(),
                attributeDescriptor.getReader().getSignature()
            );
            itr.writeByte( Opcode.INVOKESPECIAL, index );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.