Examples of ConstantPoolInfo


Examples of net.sf.rej.java.constantpool.ConstantPoolInfo

  }

  @Override
  public List<StackElement> getPushedElements(DecompilationContext dc) {
    List<StackElement> elements = new ArrayList<StackElement>();
    ConstantPoolInfo cpi = dc.getConstantPool().get(this.index);
    if (cpi instanceof DoubleInfo) {
      elements.add(new StackElement("value", StackElementType.DOUBLE));
    } else if (cpi instanceof LongInfo) {
      elements.add(new StackElement("value", StackElementType.LONG));
    } else {
      throw new AssertionError("ldc2_w points to an invalid item on the constant pool: " + cpi.getClass());
    }
    return elements;
  }
View Full Code Here

Examples of net.sf.rej.java.constantpool.ConstantPoolInfo

  @Override
  public void processInstruction(IterationContext sc, Instruction instruction) {
    Parameters params = instruction.getParameters();
    for (int i = 0; i < params.getCount(); i++) {
      if (params.getType(i) == ParameterType.TYPE_CONSTANT_POOL_FIELD_REF) {
        ConstantPoolInfo cpi = sc.getDc().getConstantPool().get(
            params.getInt(i));
        RefInfo ri = (RefInfo) cpi;
        boolean classNamesMatch = ri.getClassName().equals(className);
        boolean fieldNamesMatch = ri.getTargetName().equals(fieldName);
        boolean descriptorsMatch = ri.getDescriptor().equals(desc);
View Full Code Here

Examples of net.sf.rej.java.constantpool.ConstantPoolInfo

  @Override
  public void processInstruction(IterationContext sc, Instruction instruction) {
    Parameters params = instruction.getParameters();
    for (int i = 0; i < params.getCount(); i++) {
      if (params.getType(i) == ParameterType.TYPE_CONSTANT_POOL_METHOD_REF) {
        ConstantPoolInfo cpi = sc.getDc().getConstantPool().get(
            params.getInt(i));
        RefInfo ri = (RefInfo) cpi;
        boolean classNamesMatch = ri.getClassName().equals(className);
        boolean methodNamesMatch = ri.getTargetName()
            .equals(methodName);
View Full Code Here

Examples of net.sf.rej.java.constantpool.ConstantPoolInfo

            case TYPE_CONSTANT: {
                sb.append(getInt(i));
                break;
            }
            case TYPE_CONSTANT_POOL_CLASS: {
                ConstantPoolInfo cpi = dc.getConstantPool().get(getInt(i));
                ClassInfo ci = (ClassInfo) cpi;
                sb.append(ci.getName());
                break;
            }
            case TYPE_CONSTANT_POOL_CONSTANT: {
                ConstantPoolInfo cpi = dc.getConstantPool().get(getInt(i));
                sb.append(cpi.getValue());
                break;
            }
            case TYPE_CONSTANT_POOL_FIELD_REF: {
                ConstantPoolInfo cpi = dc.getConstantPool().get(getInt(i));
                RefInfo ri = (RefInfo) cpi;
                Descriptor desc = ri.getDescriptor();
                sb.append(desc.getReturn() + " " + ri.getClassName() + "."
                        + ri.getTargetName());
                break;
            }
            case TYPE_CONSTANT_POOL_METHOD_REF: {
                ConstantPoolInfo cpi = dc.getConstantPool().get(getInt(i));
                RefInfo ri = (RefInfo) cpi;
                Descriptor desc = ri.getDescriptor();
                sb.append(desc.getReturn() + " " + ri.getClassName() + "."
                        + ri.getTargetName() + "(" + desc.getParams() + ")");
                break;
View Full Code Here

Examples of net.sf.rej.java.constantpool.ConstantPoolInfo

  }

  @Override
  public List<StackElement> getPushedElements(DecompilationContext dc) {
    List<StackElement> elements = new ArrayList<StackElement>();
    ConstantPoolInfo cpi = dc.getConstantPool().get(this.index);
    if (cpi instanceof IntegerInfo) {
      elements.add(new StackElement("value", StackElementType.INT));
    } else if (cpi instanceof FloatInfo) {
      elements.add(new StackElement("value", StackElementType.FLOAT));
    } else if (cpi instanceof StringInfo) {
      elements.add(new StackElement("value", StackElementType.REF));
    } else {
      throw new AssertionError("ldc points to an invalid item on the constant pool: " + cpi.getClass());
    }
    return elements;
  }
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.