Package org.apache.harmony.unpack200.bytecode

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


        ArrayList orderedAttributeList = new ArrayList(codeAttributes.length);
        for (int classIndex = 0; classIndex < codeAttributes.length; classIndex++) {
            ArrayList currentAttributes = new ArrayList(codeAttributes[classIndex].size());
            for (int attributeIndex = 0; attributeIndex < codeAttributes[classIndex]
                    .size(); attributeIndex++) {
                Attribute attribute = (Attribute) codeAttributes[classIndex]
                        .get(attributeIndex);
                currentAttributes.add(attribute);
            }
            orderedAttributeList.add(currentAttributes);
        }
View Full Code Here


                            operandManager, exceptionTable);
                    ArrayList methodAttributesList = methodAttributes[c][m];
                    // Make sure we add the code attribute in the right place
                    int indexForCodeAttr = 0;
                    for (int index = 0; index < methodAttributesList.size(); index++) {
                        Attribute attribute = (Attribute) methodAttributesList.get(index);
                        if((attribute instanceof NewAttribute && ((NewAttribute)attribute).getLayoutIndex() < 15)) {
                            indexForCodeAttr ++;
                        } else {
                            break;
                        }
                    }
                    methodAttributesList.add(indexForCodeAttr, codeAttr);
                    codeAttr.renumber(codeAttr.byteCodeOffsets);
                    List currentAttributes;
                    if (allCodeHasFlags) {
                        currentAttributes = (List) orderedCodeAttributes.get(i);
                    } else {
                        if (codeHasFlags[i]) {
                            currentAttributes = (List) orderedCodeAttributes
                                    .get(codeAttributeIndex);
                            codeAttributeIndex++;
                        } else {
                            currentAttributes = Collections.EMPTY_LIST;
                        }
                    }
                    for (int index = 0; index < currentAttributes.size(); index++) {
                        Attribute currentAttribute = (Attribute) currentAttributes
                                .get(index);
                        codeAttr.addAttribute(currentAttribute);
                        // Fix up the line numbers if needed
                        if (currentAttribute.hasBCIRenumbering()) {
                            ((BCIRenumberedAttribute) currentAttribute)
                                    .renumber(codeAttr.byteCodeOffsets);
                        }
                    }
                    i++;
View Full Code Here

        ArrayList orderedAttributeList = new ArrayList(codeAttributes.length);
        for (int classIndex = 0; classIndex < codeAttributes.length; classIndex++) {
            ArrayList currentAttributes = new ArrayList(codeAttributes[classIndex].size());
            for (int attributeIndex = 0; attributeIndex < codeAttributes[classIndex]
                    .size(); attributeIndex++) {
                Attribute attribute = (Attribute) codeAttributes[classIndex]
                        .get(attributeIndex);
                currentAttributes.add(attribute);
            }
            orderedAttributeList.add(currentAttributes);
        }
View Full Code Here

        ArrayList orderedAttributeList = new ArrayList(codeAttributes.length);
        for (int classIndex = 0; classIndex < codeAttributes.length; classIndex++) {
            ArrayList currentAttributes = new ArrayList(codeAttributes[classIndex].size());
            for (int attributeIndex = 0; attributeIndex < codeAttributes[classIndex]
                    .size(); attributeIndex++) {
                Attribute attribute = (Attribute) codeAttributes[classIndex]
                        .get(attributeIndex);
                currentAttributes.add(attribute);
            }
            orderedAttributeList.add(currentAttributes);
        }
View Full Code Here

                            operandManager, exceptionTable);
                    ArrayList methodAttributesList = methodAttributes[c][m];
                    // Make sure we add the code attribute in the right place
                    int indexForCodeAttr = 0;
                    for (int index = 0; index < methodAttributesList.size(); index++) {
                        Attribute attribute = (Attribute) methodAttributesList.get(index);
                        if((attribute instanceof NewAttribute && ((NewAttribute)attribute).getLayoutIndex() < 15)) {
                            indexForCodeAttr ++;
                        } else {
                            break;
                        }
                    }
                    methodAttributesList.add(indexForCodeAttr, codeAttr);
                    codeAttr.renumber(codeAttr.byteCodeOffsets);
                    List currentAttributes;
                    if (allCodeHasFlags) {
                        currentAttributes = (List) orderedCodeAttributes.get(i);
                    } else {
                        if (codeHasFlags[i]) {
                            currentAttributes = (List) orderedCodeAttributes
                                    .get(codeAttributeIndex);
                            codeAttributeIndex++;
                        } else {
                            currentAttributes = Collections.EMPTY_LIST;
                        }
                    }
                    for (int index = 0; index < currentAttributes.size(); index++) {
                        Attribute currentAttribute = (Attribute) currentAttributes
                                .get(index);
                        codeAttr.addAttribute(currentAttribute);
                        // Fix up the line numbers if needed
                        if (currentAttribute.hasBCIRenumbering()) {
                            ((BCIRenumberedAttribute) currentAttribute)
                                    .renumber(codeAttr.byteCodeOffsets);
                        }
                    }
                    i++;
View Full Code Here

        // that will
        // be written out. Keep SourceFileAttributes out since we just
        // did them above.
        ArrayList classAttributesWithoutSourceFileAttribute = new ArrayList(classAttributes.size());
        for (int index = 0; index < classAttributes.size(); index++) {
            Attribute attrib = (Attribute) classAttributes.get(index);
            if (!attrib.isSourceFileAttribute()) {
                classAttributesWithoutSourceFileAttribute.add(attrib);
            }
        }
        Attribute[] originalAttributes = classFile.attributes;
        classFile.attributes = new Attribute[originalAttributes.length
                + classAttributesWithoutSourceFileAttribute.size()];
        System.arraycopy(originalAttributes, 0, classFile.attributes, 0,
                originalAttributes.length);
        for (int index = 0; index < classAttributesWithoutSourceFileAttribute
                .size(); index++) {
            Attribute attrib = ((Attribute) classAttributesWithoutSourceFileAttribute
                    .get(index));
            cp.add(attrib);
            classFile.attributes[originalAttributes.length + index] = attrib;
        }
View Full Code Here

        ArrayList orderedAttributeList = new ArrayList(codeAttributes.length);
        for (int classIndex = 0; classIndex < codeAttributes.length; classIndex++) {
            ArrayList currentAttributes = new ArrayList(codeAttributes[classIndex].size());
            for (int attributeIndex = 0; attributeIndex < codeAttributes[classIndex]
                    .size(); attributeIndex++) {
                Attribute attribute = (Attribute) codeAttributes[classIndex]
                        .get(attributeIndex);
                currentAttributes.add(attribute);
            }
            orderedAttributeList.add(currentAttributes);
        }
View Full Code Here

        // that will
        // be written out. Keep SourceFileAttributes out since we just
        // did them above.
        ArrayList classAttributesWithoutSourceFileAttribute = new ArrayList(classAttributes.size());
        for (int index = 0; index < classAttributes.size(); index++) {
            Attribute attrib = (Attribute) classAttributes.get(index);
            if (!attrib.isSourceFileAttribute()) {
                classAttributesWithoutSourceFileAttribute.add(attrib);
            }
        }
        Attribute[] originalAttributes = classFile.attributes;
        classFile.attributes = new Attribute[originalAttributes.length
                + classAttributesWithoutSourceFileAttribute.size()];
        System.arraycopy(originalAttributes, 0, classFile.attributes, 0,
                originalAttributes.length);
        for (int index = 0; index < classAttributesWithoutSourceFileAttribute
                .size(); index++) {
            Attribute attrib = ((Attribute) classAttributesWithoutSourceFileAttribute
                    .get(index));
            cp.add(attrib);
            classFile.attributes[originalAttributes.length + index] = attrib;
        }
View Full Code Here

        // that will
        // be written out. Keep SourceFileAttributes out since we just
        // did them above.
        ArrayList classAttributesWithoutSourceFileAttribute = new ArrayList(classAttributes.size());
        for (int index = 0; index < classAttributes.size(); index++) {
            Attribute attrib = (Attribute) classAttributes.get(index);
            if (!attrib.isSourceFileAttribute()) {
                classAttributesWithoutSourceFileAttribute.add(attrib);
            }
        }
        Attribute[] originalAttributes = classFile.attributes;
        classFile.attributes = new Attribute[originalAttributes.length
                + classAttributesWithoutSourceFileAttribute.size()];
        System.arraycopy(originalAttributes, 0, classFile.attributes, 0,
                originalAttributes.length);
        for (int index = 0; index < classAttributesWithoutSourceFileAttribute
                .size(); index++) {
            Attribute attrib = ((Attribute) classAttributesWithoutSourceFileAttribute
                    .get(index));
            cp.add(attrib);
            classFile.attributes[originalAttributes.length + index] = attrib;
        }
View Full Code Here

        ArrayList orderedAttributeList = new ArrayList(codeAttributes.length);
        for (int classIndex = 0; classIndex < codeAttributes.length; classIndex++) {
            ArrayList currentAttributes = new ArrayList(codeAttributes[classIndex].size());
            for (int attributeIndex = 0; attributeIndex < codeAttributes[classIndex]
                    .size(); attributeIndex++) {
                Attribute attribute = (Attribute) codeAttributes[classIndex]
                        .get(attributeIndex);
                currentAttributes.add(attribute);
            }
            orderedAttributeList.add(currentAttributes);
        }
View Full Code Here

TOP

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

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.