Package org.apache.harmony.unpack200.bytecode

Examples of org.apache.harmony.unpack200.bytecode.CPUTF8


        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 CPUTF8(reference[index]);
        }
        return result;
    }
View Full Code Here


        for (int i1 = 0; i1 < sum; 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);
            result1[i1] = new CPUTF8(reference[index]);
        }
        CPUTF8[] refs = result1;
        int pos = 0;
        for (int i = 0; i < counts.length; i++) {
            int num = counts[i];
View Full Code Here

                    // we've got a signature attribute
                    long result = fieldSignatureRS[signatureIndex];
                    String desc = fieldDescr[i][j];
                    int colon = desc.indexOf(':');
                    String type = desc.substring(colon + 1);
                    CPUTF8 value = new CPUTF8((String) signatureLayout.getValue(result, type,
                            cpBands.getConstantPool()));
                    fieldAttributes[i][j]
                            .add(new SignatureAttribute(value));
                    signatureIndex++;
                }
View Full Code Here

    private CPUTF8[][] stringsToCPUTF8(String[][] strings) {
        CPUTF8[][] cpUTF8s = new CPUTF8[strings.length][];
        for (int i = 0; i < strings.length; i++) {
            cpUTF8s[i] = new CPUTF8[strings[i].length];
            for (int j = 0; j < strings[i].length; j++) {
                cpUTF8s[i][j] = new CPUTF8(strings[i][j]);
            }
        }
        return cpUTF8s;
    }
View Full Code Here


    private CPUTF8[] stringsToCPUTF8(String[] strings) {
        CPUTF8[] cpUTF8s = new CPUTF8[strings.length];
        for (int i = 0; i < strings.length; i++) {
            cpUTF8s[i] = new CPUTF8(strings[i]);
        }
        return cpUTF8s;
    }
View Full Code Here

                    int nextT = ((Integer)T_iterator.next()).intValue();
                    nestedArray[i] = new ElementValue(nextT, getNextValue(nextT));
                }
                return nestedArray;
            case '@':
                CPUTF8 type = (CPUTF8) nesttype_RS_Iterator.next();
                int numPairs = ((Integer)nestpair_N_Iterator.next()).intValue();
               
                return getAnnotation(type, numPairs, nestname_RU_Iterator);
        }
        return null;
View Full Code Here

        if (index == -1) {
            return null;
        } else if (index < 0) {
            throw new Pack200Exception("Cannot have a negative range");
        } else if (cp == UTF_8) {
            return new CPUTF8(bands.getCpUTF8()[index]);
        } else if (cp == CP_INT) {
            return new CPInteger(new Integer(bands.getCpInt()[index]));
        } else if (cp == CP_FLOAT) {
            return new CPFloat(new Float(bands.getCpFloat()[index]));
        } else if (cp == CP_LONG) {
View Full Code Here

import org.apache.harmony.pack200.bytecode.ClassConstantPool;
import org.apache.harmony.pack200.bytecode.SourceFileAttribute;

public class ClassFileEntryTest extends TestCase {
  public void testUTF8() {
    CPUTF8 u1 = new CPUTF8(new String("thing"), ClassConstantPool.DOMAIN_UNDEFINED); //$NON-NLS-1$
    CPUTF8 u2 = new CPUTF8(new String("thing"), ClassConstantPool.DOMAIN_UNDEFINED); //$NON-NLS-1$
    CPUTF8 u3 = new CPUTF8(new String("otherthing"), ClassConstantPool.DOMAIN_UNDEFINED); //$NON-NLS-1$
    checkEquality(u1, u2, "thing", u3);
  }
View Full Code Here

  public void setUp() {
    pool = new ClassConstantPool();
  }
  public void testDuplicateUTF8() {
    CPUTF8 u1 = new CPUTF8("thing", ClassConstantPool.DOMAIN_NORMALASCIIZ);
    CPUTF8 u2 = new CPUTF8("thing", ClassConstantPool.DOMAIN_NORMALASCIIZ);
    pool.add(u1);
    pool.add(u2);
    assertEquals(1,pool.size());
  }
View Full Code Here

    CPMember cp2 = new CPMember("name:I",0,null);
    pool.add(cp2);
    assertEquals(2,pool.size());
  }
  public void testIndex() {
    pool.add(new CPUTF8("OtherThing", ClassConstantPool.DOMAIN_NORMALASCIIZ));
    CPUTF8 u1 = new CPUTF8("thing", ClassConstantPool.DOMAIN_NORMALASCIIZ);
    pool.add(u1);
    pool.resolve();
    assertTrue(pool.indexOf(u1) > 0);
  }
View Full Code Here

TOP

Related Classes of org.apache.harmony.unpack200.bytecode.CPUTF8

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.