Package net.sf.rej.java.constantpool

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


  }

  @Override
  public List<StackElement> getPoppedElements(DecompilationContext dc) {
    List<StackElement> elements = new ArrayList<StackElement>();
    RefInfo ri = (RefInfo) dc.getConstantPool().get(this.index);
    Descriptor desc = ri.getDescriptor();
    JavaType jt = desc.getReturn();
    if (jt.getDimensionCount() > 0 || (!jt.isPrimitive())) {
      // array or primitive are both refs
      elements.add(new StackElement("value", StackElementType.REF));
    } else {
View Full Code Here


  }

  @Override
  public List<StackElement> getPushedElements(DecompilationContext dc) {
    List<StackElement> elements = new ArrayList<StackElement>();
    RefInfo ri = (RefInfo) dc.getConstantPool().get(this.index);
    Descriptor desc = ri.getDescriptor();
    JavaType jt = desc.getReturn();
    if (jt.getDimensionCount() > 0 || (!jt.isPrimitive())) {
      // array or primitive are both refs
      elements.add(new StackElement("result", StackElementType.REF));
    } else {
View Full Code Here

    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);

        if (classNamesMatch) {
          String instructionLine = instruction.getMnemonic() + " "
              + instruction.getParameters().getString(sc.getDc());
          Link link = new Link();
          link.setText("Field Ref : " + sc.getCf().getFullClassName() + "." + sc.getMethod().getName() + " / " + instructionLine);
          link.setAnchor(Link.ANCHOR_METHOD_CODE);
          link.setProject(sc.getProject());
          link.setFile(sc.getFilename());
          link.setTab(Tab.EDITOR);
          link.setMethod(sc.getMethod());
          link.setPosition(sc.getDc().getPosition());

          MainWindow.getInstance().getSearchTab().addResult(link);
          this.resultCount++;
        }

      } else 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);

        if (classNamesMatch) {
          String instructionLine = instruction.getMnemonic() + " "
              + instruction.getParameters().getString(sc.getDc());
          Link link = new Link();
View Full Code Here

            Object content = wrapper.getContent();
            if(content instanceof MethodLocator) {
                MethodLocator ml = (MethodLocator)content;
                return ml;
            } else {
                RefInfo ri = (RefInfo) ( (Wrapper) o).getContent();
                value = this.cp.optionalAdd(ri);
            }
        }

        return Integer.valueOf(value);
View Full Code Here

              }
             
              break;
            }
            case TYPE_CONSTANT_POOL_FIELD_REF: {
              RefInfo ri = (RefInfo) sourcePool.get(params.getInt(i));
              int index = destinationPool.optionalAddFieldRef(ri.getClassName(), ri.getTargetName(), ri.getMethodType());
            copyParams.addValue(index);
              break;
            }
            case TYPE_CONSTANT_POOL_METHOD_REF: {
              RefInfo ri = (RefInfo) sourcePool.get(params.getInt(i));
              int index = destinationPool.optionalAddMethodRef(ri.getClassName(), ri.getTargetName(), ri.getMethodType());
            copyParams.addValue(index);
              break;
            }
            case TYPE_LABEL:
              Label label = (Label) params.getObject(i);
View Full Code Here

            Object content = wrapper.getContent();
            if(content instanceof FieldLocator) {
                FieldLocator fl = (FieldLocator)content;
                return fl;
            } else {
                RefInfo ri = (RefInfo) ( (Wrapper) o).getContent();
                value = this.cp.optionalAdd(ri);
            }
        }

        return Integer.valueOf(value);
View Full Code Here

        } else {
          SystemFacade.getInstance().performAction(u, ic.getFilename());
        }
      }
    } if(cpi.getType() == ConstantPoolInfo.FIELD_REF) {
      RefInfo ri = (RefInfo)cpi;
      String className = ri.getClassName();
      String newFieldName = this.advisor.newFieldNameFor(className, ri.getTargetName(), ri.getDescriptor());
      if (newFieldName != null) {
        NameAndTypeInfo nati = ri.getNameAndTypeInfo();
       
        Undoable u = new ModifyNameAndTypeInfoAction(ic.getCf().getPool(), nati, newFieldName);
        if (this.batchMode) {
          u.execute();
        } else {
          SystemFacade.getInstance().performAction(u, ic.getFilename());         
        }
      }
    } else if(cpi.getType() == ConstantPoolInfo.METHOD_REF || cpi.getType() == ConstantPoolInfo.INTERFACE_METHOD_REF) {
      RefInfo ri = (RefInfo)cpi;
      String className = ri.getClassName();
      String newMethodName = this.advisor.newMethodNameFor(className, ri.getTargetName(), ri.getDescriptor());
      if (newMethodName != null) {
        NameAndTypeInfo nati = ri.getNameAndTypeInfo();
        Undoable u = new ModifyNameAndTypeInfoAction(ic.getCf().getPool(), nati, newMethodName);
        if (this.batchMode) {
          u.execute();
        } else {
          SystemFacade.getInstance().performAction(u, ic.getFilename());         
View Full Code Here

  @Override
  public List<StackElement> getPoppedElements(DecompilationContext dc) {
    List<StackElement> elements = new ArrayList<StackElement>();
    // objectref of the object whose method is being called
    elements.add(new StackElement("objectref", StackElementType.REF));
    RefInfo ri = (RefInfo) dc.getConstantPool().get(this.index);
    Descriptor desc = ri.getDescriptor();
    int i=0;
    for (JavaType jt : desc.getParamList()) {
      i++;
      String argName = "arg" + i;
      if (jt.getDimensionCount() > 0 || (!jt.isPrimitive())) {
View Full Code Here

  }

  @Override
  public List<StackElement> getPushedElements(DecompilationContext dc) {
    List<StackElement> elements = new ArrayList<StackElement>();
    RefInfo ri = (RefInfo) dc.getConstantPool().get(this.index);
    Descriptor desc = ri.getDescriptor();
    JavaType jt = desc.getReturn();
    if (jt.getDimensionCount() > 0 || (!jt.isPrimitive())) {
      // array or primitive are both refs
      elements.add(new StackElement("result", StackElementType.REF));
    } else {
View Full Code Here

  }

  @Override
  public List<StackElement> getPoppedElements(DecompilationContext dc) {
    List<StackElement> elements = new ArrayList<StackElement>();
    RefInfo ri = (RefInfo) dc.getConstantPool().get(this.index);
    Descriptor desc = ri.getDescriptor();
    int i=0;
    for (JavaType jt : desc.getParamList()) {
      i++;
      String argName = "arg" + i;
      if (jt.getDimensionCount() > 0 || (!jt.isPrimitive())) {
View Full Code Here

TOP

Related Classes of net.sf.rej.java.constantpool.RefInfo

Copyright © 2018 www.massapicom. 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.