Package org.apache.harmony.pack200.bytecode

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


                sourceFileIndex++;
            }
            if (enclosingMethodLayout.matches(flag)) {
                CPClass theClass = cpBands
                        .cpClassValue(enclosingMethodRC[enclosingMethodIndex]);
                CPNameAndType theMethod = null;
                if(enclosingMethodRDN[enclosingMethodIndex] != 0) {
                    theMethod = cpBands
                            .cpNameAndTypeValue(enclosingMethodRDN[enclosingMethodIndex] - 1);
                }
                classAttributes[i].add(new EnclosingMethodAttribute(theClass,
View Full Code Here


        return cpDouble;
    }

    public CPNameAndType cpNameAndTypeValue(int index) {
        String descriptor = cpDescriptor[index];
        CPNameAndType cpNameAndType = (CPNameAndType) descriptorsToCPNameAndTypes
                .get(descriptor);
        if (cpNameAndType == null) {
            int nameIndex = cpDescriptorNameInts[index];
            int descriptorIndex = cpDescriptorTypeInts[index];

            CPUTF8 name = cpUTF8Value(nameIndex);
            CPUTF8 descriptorU = cpSignatureValue(descriptorIndex);
            cpNameAndType = new CPNameAndType(name, descriptorU, index + descrOffset);
            descriptorsToCPNameAndTypes.put(descriptor, cpNameAndType);
        }
        return cpNameAndType;
    }
View Full Code Here

        }
        return cpUTF8;
    }

    public CPNameAndType cpNameAndTypeValue(String descriptor) {
        CPNameAndType cpNameAndType = (CPNameAndType) descriptorsToCPNameAndTypes
            .get(descriptor);
        if (cpNameAndType == null) {
          Integer index = (Integer)mapDescriptor.get(descriptor);
          if(index != null) {
            return cpNameAndTypeValue(index.intValue());
            }
            int colon = descriptor.indexOf(':');
            String nameString = descriptor.substring(0, colon);
            String descriptorString = descriptor.substring(colon + 1);

            CPUTF8 name = cpUTF8Value(nameString, true);
            CPUTF8 descriptorU = cpUTF8Value(descriptorString, true);
            cpNameAndType = new CPNameAndType(name, descriptorU, -1 + descrOffset);
            descriptorsToCPNameAndTypes.put(descriptor, cpNameAndType);
        }
        return cpNameAndType;
    }
View Full Code Here

                sourceFileIndex++;
            }
            if (enclosingMethodLayout.matches(flag)) {
                CPClass theClass = cpBands
                        .cpClassValue(enclosingMethodRC[enclosingMethodIndex]);
                CPNameAndType theMethod = null;
                if(enclosingMethodRDN[enclosingMethodIndex] != 0) {
                    theMethod = cpBands
                            .cpNameAndTypeValue(enclosingMethodRDN[enclosingMethodIndex] - 1);
                }
                classAttributes[i].add(new EnclosingMethodAttribute(theClass,
View Full Code Here

        return cpDouble;
    }

    public CPNameAndType cpNameAndTypeValue(int index) {
        String descriptor = cpDescriptor[index];
        CPNameAndType cpNameAndType = (CPNameAndType) descriptorsToCPNameAndTypes
                .get(descriptor);
        if (cpNameAndType == null) {
            int nameIndex = cpDescriptorNameInts[index];
            int descriptorIndex = cpDescriptorTypeInts[index];
            String descriptorString = cpSignature[descriptorIndex];

            // For some reason, descriptors which have just plain
            // native types are stored in DOMAIN_NORMALASCIIZ rather
            // than in DOMAIN_SIGNATUREASCIIZ. This might indicate
            // that DOMAIN_SIGNATUREASCIIZ is poorly named.
            boolean nativeDescriptor = true;
            for (int i = 0; i < descriptorString.length(); i++) {
                char currentChar = descriptorString.charAt(i);
                if (Character.isLetter(currentChar)) {
                    if (currentChar == 'L') {
                        nativeDescriptor = false;
                    }
                    break;
                }
            }
            CPUTF8 name = cpUTF8Value(nameIndex);
            CPUTF8 descriptorU = cpSignatureValue(descriptorIndex);
            cpNameAndType = new CPNameAndType(name, descriptorU, index + descrOffset);
            descriptorsToCPNameAndTypes.put(descriptor, cpNameAndType);
        }
        return cpNameAndType;
    }
View Full Code Here

        }
        return cpUTF8;
    }

    public CPNameAndType cpNameAndTypeValue(String descriptor) {
        CPNameAndType cpNameAndType = (CPNameAndType) descriptorsToCPNameAndTypes
            .get(descriptor);
        if (cpNameAndType == null) {
          Integer index = (Integer)mapDescriptor.get(descriptor);
          if(index != null) {
            return cpNameAndTypeValue(index.intValue());
            }
            int colon = descriptor.indexOf(':');
            String nameString = descriptor.substring(0, colon);
            String descriptorString = descriptor.substring(colon + 1);
            // For some reason, descriptors which have just plain
            // native types are stored in DOMAIN_NORMALASCIIZ rather
            // than in DOMAIN_SIGNATUREASCIIZ. This might indicate
            // that DOMAIN_SIGNATUREASCIIZ is poorly named.
            boolean nativeDescriptor = true;
            for (int i = 0; i < descriptorString.length(); i++) {
                char currentChar = descriptorString.charAt(i);
                if (Character.isLetter(currentChar)) {
                    if (currentChar == 'L') {
                        nativeDescriptor = false;
                    }
                    break;
                }
            }
            CPUTF8 name = cpUTF8Value(nameString, true);
            CPUTF8 descriptorU = cpUTF8Value(descriptorString, true);
            cpNameAndType = new CPNameAndType(name, descriptorU, -1 + descrOffset);
            descriptorsToCPNameAndTypes.put(descriptor, cpNameAndType);
        }
        return cpNameAndType;
    }
View Full Code Here

                sourceFileIndex++;
            }
            if (enclosingMethodLayout.matches(flag)) {
                CPClass theClass = cpBands
                        .cpClassValue(enclosingMethodRC[enclosingMethodIndex]);
                CPNameAndType theMethod = null;
                if(enclosingMethodRDN[enclosingMethodIndex] != 0) {
                    theMethod = cpBands
                            .cpNameAndTypeValue(enclosingMethodRDN[enclosingMethodIndex] - 1);
                }
                classAttributes[i].add(new EnclosingMethodAttribute(theClass,
View Full Code Here

        return cpDouble;
    }

    public CPNameAndType cpNameAndTypeValue(int index) {
        String descriptor = cpDescriptor[index];
        CPNameAndType cpNameAndType = (CPNameAndType) descriptorsToCPNameAndTypes
                .get(descriptor);
        if (cpNameAndType == null) {
            int descriptorDomain = ClassConstantPool.DOMAIN_UNDEFINED;
            int nameIndex = cpDescriptorNameInts[index];
            int descriptorIndex = cpDescriptorTypeInts[index];
            String descriptorString = cpSignature[descriptorIndex];
               
            // For some reason, descriptors which have just plain
            // native types are stored in DOMAIN_NORMALASCIIZ rather
            // than in DOMAIN_SIGNATUREASCIIZ. This might indicate
            // that DOMAIN_SIGNATUREASCIIZ is poorly named.
            boolean nativeDescriptor = true;
            for (int i = 0; i < descriptorString.length(); i++) {
                char currentChar = descriptorString.charAt(i);
                if (Character.isLetter(currentChar)) {
                    if (currentChar == 'L') {
                        nativeDescriptor = false;
                    }
                    break;
                }
            }
            int domain = ClassConstantPool.DOMAIN_NAMEANDTYPE;
            CPUTF8 name = cpUTF8Value(nameIndex,
                    ClassConstantPool.DOMAIN_NORMALASCIIZ);
            if (nativeDescriptor) {
                // Native signatures are stored in DOMAIN_NORMALASCIIZ, not
                // DOMAIN_SIGNATUREASCIIZ for some reason.
                descriptorDomain = ClassConstantPool.DOMAIN_NORMALASCIIZ;
            } else {
                descriptorDomain = ClassConstantPool.DOMAIN_SIGNATUREASCIIZ;
            }
            CPUTF8 descriptorU = cpSignatureValue(descriptorIndex, descriptorDomain);
            cpNameAndType = new CPNameAndType(name, descriptorU, domain, index + descrOffset);
            descriptorsToCPNameAndTypes.put(descriptor, cpNameAndType);
        }
        return cpNameAndType;
    }
View Full Code Here

        }
        return cpUTF8;
    }

    public CPNameAndType cpNameAndTypeValue(String descriptor) {
        CPNameAndType cpNameAndType = (CPNameAndType) descriptorsToCPNameAndTypes
            .get(descriptor);
        if (cpNameAndType == null) {
            int index = search(cpDescriptor, descriptor);
            if(index != -1) {
                return cpNameAndTypeValue(index);
            }
            int descriptorDomain = ClassConstantPool.DOMAIN_UNDEFINED;
            int colon = descriptor.indexOf(':');
            String nameString = descriptor.substring(0, colon);
            String descriptorString = descriptor.substring(colon + 1);
            // For some reason, descriptors which have just plain
            // native types are stored in DOMAIN_NORMALASCIIZ rather
            // than in DOMAIN_SIGNATUREASCIIZ. This might indicate
            // that DOMAIN_SIGNATUREASCIIZ is poorly named.
            boolean nativeDescriptor = true;
            for (int i = 0; i < descriptorString.length(); i++) {
                char currentChar = descriptorString.charAt(i);
                if (Character.isLetter(currentChar)) {
                    if (currentChar == 'L') {
                        nativeDescriptor = false;
                    }
                    break;
                }
            }
            int domain = ClassConstantPool.DOMAIN_NAMEANDTYPE;
            CPUTF8 name = cpUTF8Value(nameString,
                    ClassConstantPool.DOMAIN_NORMALASCIIZ, true);
            if (nativeDescriptor) {
                // Native signatures are stored in DOMAIN_NORMALASCIIZ, not
                // DOMAIN_SIGNATUREASCIIZ for some reason.
                descriptorDomain = ClassConstantPool.DOMAIN_NORMALASCIIZ;
            } else {
                descriptorDomain = ClassConstantPool.DOMAIN_SIGNATUREASCIIZ;
            }
            CPUTF8 descriptorU = cpUTF8Value(descriptorString, descriptorDomain, true);
            cpNameAndType = new CPNameAndType(name, descriptorU, domain, index + descrOffset);
            descriptorsToCPNameAndTypes.put(descriptor, cpNameAndType);
        }
        return cpNameAndType;
    }
View Full Code Here

                sourceFileIndex++;
            }
            if (enclosingMethodLayout.matches(flag)) {
                CPClass theClass = cpBands
                        .cpClassValue(enclosingMethodRC[enclosingMethodIndex]);
                CPNameAndType theMethod = cpBands
                        .cpNameAndTypeValue(enclosingMethodRDN[enclosingMethodIndex]);
                classAttributes[i].add(new EnclosingMethodAttribute(theClass,
                        theMethod));
                enclosingMethodIndex++;
            }
View Full Code Here

TOP

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

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.