Package org.apache.harmony.pack200.bytecode

Examples of org.apache.harmony.pack200.bytecode.CPString


                if (n > 0) {
                   CPClass[] exceptions = new CPClass[n];
                   if (layout.matches(flag)) {
                       for (int k = 0; k < n; k++) {
                           long result = codec.decode(in);
                           exceptions[k] = new CPClass(cpBands.getCpClass()[(int) result]);
                       }
                   }
                   methodExceptions[i][j] = new ExceptionsAttribute(exceptions);
                   methodAttributes[i][j].add(methodExceptions[i][j]);
               }
View Full Code Here


          .add(new SourceFileAttribute(fileName)) };
    } else {
      classFile.attributes = new Attribute[] {};
    }
    // this/superclass
    ClassFileEntry cfThis = cp.add(new CPClass(fullName));
    ClassFileEntry cfSuper = cp.add(new CPClass(classBands.getClassSuper()[classNum]));
    // add interfaces
    ClassFileEntry cfInterfaces[] = new ClassFileEntry[classBands.getClassInterfaces()[classNum].length];
    for (i = 0; i < cfInterfaces.length; i++) {
      cfInterfaces[i] = cp.add(new CPClass(classBands.getClassInterfaces()[classNum][i]));
    }
    // add fields
    ClassFileEntry cfFields[] = new ClassFileEntry[classBands.getClassFieldCount()[classNum]];
    // fieldDescr and fieldFlags used to create this
    for (i = 0; i < cfFields.length; i++) {
View Full Code Here

    }
    // add fields
    ClassFileEntry cfFields[] = new ClassFileEntry[classBands.getClassFieldCount()[classNum]];
    // fieldDescr and fieldFlags used to create this
    for (i = 0; i < cfFields.length; i++) {
      cfFields[i] = cp.add(new CPField(classBands.getFieldDescr()[classNum][i],
                    classBands.getFieldFlags()[classNum][i], classBands.getFieldAttributes()[classNum][i]));
    }
    // add methods
    ClassFileEntry cfMethods[] = new ClassFileEntry[classBands.getClassMethodCount()[classNum]];
    // fieldDescr and fieldFlags used to create this
View Full Code Here

    }
    // add methods
    ClassFileEntry cfMethods[] = new ClassFileEntry[classBands.getClassMethodCount()[classNum]];
    // fieldDescr and fieldFlags used to create this
    for (i = 0; i < cfMethods.length; i++) {
      cfMethods[i] = cp.add(new CPMethod(classBands.getMethodDescr()[classNum][i],
                    classBands.getMethodFlags()[classNum][i], classBands.getMethodAttributes()[classNum][i]));
    }
    // sort CP according to cp_All
    cp.resolve();
    // print out entries
View Full Code Here

   
    protected void setNestedEntries(ByteCode byteCode, OperandManager operandManager, int offset) throws Pack200Exception {
        SegmentConstantPool globalPool = operandManager.globalConstantPool();
        ClassFileEntry[] nested = null;
        nested = new ClassFileEntry[] {
                new CPString((String)globalPool.getValue(getPoolID(), offset))
                };
        byteCode.setNested(nested);
        if(widened) {
            byteCode.setNestedPositions(new int[][]{{0, 2}});
        } else {
View Full Code Here

        } else if (cp == CP_LONG) {
            return new CPLong(new Long(bands.getCpLong()[index]));
        } else if (cp == CP_DOUBLE) {
            return new CPDouble(new Double(bands.getCpDouble()[index]));
        } else if (cp == CP_STRING) {
            return new CPString(bands.getCpString()[index]);
        } else if (cp == CP_CLASS) {
            return new CPClass(bands.getCpClass()[index]);
        } else if (cp == SIGNATURE) {
          throw new Error("I don't know what to do with signatures yet");
//            return null /* new CPSignature(bands.getCpSignature()[index]) */;
 
View Full Code Here

    protected void setNestedEntries(ByteCode byteCode, OperandManager operandManager, int offset) throws Pack200Exception {
        SegmentConstantPool globalPool = operandManager.globalConstantPool();
        ClassFileEntry[] nested = null;
        nested = new ClassFileEntry[] {
                new CPString((String)globalPool.getValue(getPoolID(), offset))
                };
        byteCode.setNested(nested);
        if(widened) {
            byteCode.setNestedPositions(new int[][]{{0, 2}});
        } else {
View Full Code Here

    CPFloat cp2 = new CPFloat(new Float(3));
    CPFloat cp3 = new CPFloat(new Float(5));
    checkEquality(cp1,cp2,"3",cp3); //$NON-NLS-1$
  }
  public void testCPString() {
    CPString cp1 = new CPString(new String("3"));
    CPString cp2 = new CPString(new String("3"));
    CPString cp3 = new CPString(new String("5"));
    checkEquality(cp1,cp2,"3",cp3); //$NON-NLS-1$
  }
View Full Code Here

        } else if (cp == CP_LONG) {
            return new CPLong(new Long(bands.getCpLong()[index]));
        } else if (cp == CP_DOUBLE) {
            return new CPDouble(new Double(bands.getCpDouble()[index]));
        } else if (cp == CP_STRING) {
            return new CPString(bands.getCpString()[index]);
        } else if (cp == CP_CLASS) {
            return new CPClass(bands.getCpClass()[index]);
        } else if (cp == SIGNATURE) {
          throw new Error("I don't know what to do with signatures yet");
//            return null /* new CPSignature(bands.getCpSignature()[index]) */;
 
View Full Code Here

        for (int i1 = 0; i1 < count; i1++) {
            int index = indices[i1];
            if (index < 0 || index >= reference.length)
                throw new Pack200Exception(
                        "Something has gone wrong during parsing references, index = " + index + ", array size = " + reference.length);
            result[i1] = new CPString(reference[index]);
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.pack200.bytecode.CPString

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.