Examples of CPUTF8


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

        String innerClassString = ic_stored[index].thisClassString();
        String outerClassString = ic_stored[index].outerClassString();
        String simpleClassName = ic_stored[index].simpleClassName();

        CPClass innerClass = null;
        CPUTF8 innerName = null;
        CPClass outerClass = null;

        if(ic_stored[index].isAnonymous()) {
            innerClass = new CPClass(innerClassString);
        } else {
              innerClass = new CPClass(innerClassString);
              innerName = new CPUTF8(simpleClassName, ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ);
        }

        if(ic_stored[index].isMember()) {
            outerClass = new CPClass(outerClassString);
        }
View Full Code Here

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

                    // 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()), ClassConstantPool.DOMAIN_SIGNATUREASCIIZ);
                    fieldAttributes[i][j]
                            .add(new SignatureAttribute(value));
                    signatureIndex++;
                }
View Full Code Here

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

        // native signatures end up in DOMAINNORMALASCIIZ
        // while nonnatives end up in DOMAINSIGNATUREASCIIZ.
        // TODO: is this the right thing to do?
        for(int x=0; x < localVariableTableTypeRS.length; x++) {
            for(int y=0; y < localVariableTableTypeRS[x].length; y++) {
                CPUTF8 element = localVariableTableTypeRS[x][y];
                // TODO: come up with a better test for native vs nonnative signatures?
                if(element.underlyingString().length() > 2) {
                    element.setDomain(ClassConstantPool.DOMAIN_SIGNATUREASCIIZ);
                } else {
                    element.setDomain(ClassConstantPool.DOMAIN_NORMALASCIIZ);
                }
            }
        }

        int lengthLocalVariableTypeTableNBand = SegmentUtils.countMatches(
View Full Code Here

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

    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], ClassConstantPool.DOMAIN_NORMALASCIIZ);
            }
        }
        return cpUTF8s;
    }
View Full Code Here

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


    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], ClassConstantPool.DOMAIN_UNDEFINED);
        }
        return cpUTF8s;
    }
View Full Code Here

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

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

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

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

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

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

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

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

        // fieldDescr and fieldFlags used to create this
        for (i = 0; i < cfFields.length; i++) {
            int descriptorIndex = classBands.getFieldDescrInts()[classNum][i];
            int nameIndex = cpBands.getCpDescriptorNameInts()[descriptorIndex];
            int typeIndex = cpBands.getCpDescriptorTypeInts()[descriptorIndex];
            CPUTF8 name = cpBands.cpUTF8Value(nameIndex);
            CPUTF8 descriptor = cpBands.cpSignatureValue(typeIndex);
            cfFields[i] = cp.add(new CPField(name, descriptor, classBands
                    .getFieldFlags()[classNum][i], classBands
                    .getFieldAttributes()[classNum][i]));
        }
        // add methods
        ClassFileEntry cfMethods[] = new ClassFileEntry[classBands
                .getClassMethodCount()[classNum]];
        // methodDescr and methodFlags used to create this
        for (i = 0; i < cfMethods.length; i++) {
            int descriptorIndex = classBands.getMethodDescrInts()[classNum][i];
//            int colon = descriptorStr.indexOf(':');
            int nameIndex = cpBands.getCpDescriptorNameInts()[descriptorIndex];
            int typeIndex = cpBands.getCpDescriptorTypeInts()[descriptorIndex];
            CPUTF8 name = cpBands.cpUTF8Value(nameIndex);
            CPUTF8 descriptor = cpBands.cpSignatureValue(typeIndex);
            cfMethods[i] = cp.add(new CPMethod(name, descriptor, classBands
                    .getMethodFlags()[classNum][i], classBands
                    .getMethodAttributes()[classNum][i]));
        }
        cp.addNestedEntries();

        // add inner class attribute (if required)
        boolean addInnerClassesAttr = false;
        IcTuple[] ic_local = getClassBands().getIcLocal()[classNum];
        boolean ic_local_sent = ic_local != null;
        InnerClassesAttribute innerClassesAttribute = new InnerClassesAttribute(
                "InnerClasses");
        IcTuple[] ic_relevant = getIcBands().getRelevantIcTuples(fullName, cp);
        List ic_stored = computeIcStored(ic_local, ic_relevant);
        for (int index = 0; index < ic_stored.size(); index++) {
          IcTuple icStored = (IcTuple)ic_stored.get(index);
            int innerClassIndex = icStored.thisClassIndex();
            int outerClassIndex = icStored.outerClassIndex();
            int simpleClassNameIndex = icStored.simpleClassNameIndex();

            String innerClassString = icStored.thisClassString();
            String outerClassString = icStored.outerClassString();
            String simpleClassName = icStored.simpleClassName();

            CPClass innerClass = null;
            CPUTF8 innerName = null;
            CPClass outerClass = null;

            innerClass = innerClassIndex != -1 ? cpBands
                    .cpClassValue(innerClassIndex) : cpBands
                    .cpClassValue(innerClassString);
View Full Code Here

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

    public void setUp() {
        pool = new ClassConstantPool();
    }

    public void testDuplicateUTF8() {
        CPUTF8 u1 = new CPUTF8("thing", 1);
        CPUTF8 u2 = new CPUTF8("thing", 1);
        pool.add(u1);
        pool.add(u2);
        assertEquals(1, pool.size());
    }
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.