Package org.apache.harmony.unpack200.bytecode

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


            }
            if (signatureLayout.matches(flag)) {
                long result = classSignature[signatureIndex];
                CPUTF8 value = (CPUTF8) signatureLayout.getValue(result, cpBands
                        .getConstantPool());
                classAttributes[i].add(new SignatureAttribute(value));
                signatureIndex++;
            }
            if (innerClassLayout.matches(flag)) {
                // Just create the tuples for now because the attributes are
                // decided at the end when creating class constant pools
View Full Code Here


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

                    if (type.equals("B") || type.equals("H"))
                        type = "I";
                    CPUTF8 value = (CPUTF8) methodSignatureLayout.getValue(
                            result, type, cpBands.getConstantPool());
                    methodAttributes[i][j]
                            .add(new SignatureAttribute(value));
                    methodSignatureIndex++;
                }
                if (deprecatedLayout.matches(flag)) {
                    methodAttributes[i][j].add(new DeprecatedAttribute());
                }
View Full Code Here

            }
            if (signatureLayout.matches(flag)) {
                long result = classSignature[signatureIndex];
                CPUTF8 value = (CPUTF8) signatureLayout.getValue(result, cpBands
                        .getConstantPool());
                classAttributes[i].add(new SignatureAttribute(value));
                signatureIndex++;
            }
            if (innerClassLayout.matches(flag)) {
                // Just create the tuples for now because the attributes are
                // decided at the end when creating class constant pools
View Full Code Here

                    String desc = fieldDescr[i][j];
                    int colon = desc.indexOf(':');
                    String type = desc.substring(colon + 1);
                    CPUTF8 value = (CPUTF8) signatureLayout.getValue(result,
                            type, cpBands.getConstantPool());
                    fieldAttributes[i][j].add(new SignatureAttribute(value));
                    signatureIndex++;
                }
                // Non-predefined attributes
                for (int k = 0; k < otherLayouts.length; k++) {
                    if (otherLayouts[k] != null
View Full Code Here

                    if (type.equals("B") || type.equals("H"))
                        type = "I";
                    CPUTF8 value = (CPUTF8) methodSignatureLayout.getValue(
                            result, type, cpBands.getConstantPool());
                    methodAttributes[i][j]
                            .add(new SignatureAttribute(value));
                    methodSignatureIndex++;
                }
                // Non-predefined attributes
                for (int k = 0; k < otherLayouts.length; k++) {
                    if (otherLayouts[k] != null
View Full Code Here

            }
            if (signatureLayout.matches(flag)) {
                long result = classSignature[signatureIndex];
                CPUTF8 value = (CPUTF8) signatureLayout.getValue(result, cpBands
                        .getConstantPool());
                classAttributes[i].add(new SignatureAttribute(value));
                signatureIndex++;
            }
            if (innerClassLayout.matches(flag)) {
                // Just create the tuples for now because the attributes are
                // decided at the end when creating class constant pools
View Full Code Here

                    String desc = fieldDescr[i][j];
                    int colon = desc.indexOf(':');
                    String type = desc.substring(colon + 1);
                    CPUTF8 value = (CPUTF8) signatureLayout.getValue(result,
                            type, cpBands.getConstantPool());
                    fieldAttributes[i][j].add(new SignatureAttribute(value));
                    signatureIndex++;
                }
                // Non-predefined attributes
                for (int k = 0; k < otherLayouts.length; k++) {
                    if (otherLayouts[k] != null
View Full Code Here

        // -1+1=0, so str.substring(0)
        // == str

        // Get the source file attribute
        ArrayList classAttributes = classBands.getClassAttributes()[classNum];
        SourceFileAttribute sourceFileAttribute = null;
        for (int index = 0; index < classAttributes.size(); index++) {
            if (((Attribute) classAttributes.get(index))
                    .isSourceFileAttribute()) {
                sourceFileAttribute = ((SourceFileAttribute) classAttributes
                        .get(index));
            }
        }

        if (sourceFileAttribute == null) {
            // If we don't have a source file attribute yet, we need
            // to infer it from the class.
            AttributeLayout SOURCE_FILE = attrDefinitionBands
                    .getAttributeDefinitionMap().getAttributeLayout(
                            AttributeLayout.ATTRIBUTE_SOURCE_FILE,
                            AttributeLayout.CONTEXT_CLASS);
            if (SOURCE_FILE.matches(classBands.getRawClassFlags()[classNum])) {
                int firstDollar = SegmentUtils.indexOfFirstDollar(fullName);
                String fileName = null;

                if (firstDollar > -1 && (i <= firstDollar)) {
                    fileName = fullName.substring(i, firstDollar) + ".java";
                } else {
                    fileName = fullName.substring(i) + ".java";
                }
                sourceFileAttribute = new SourceFileAttribute(cpBands
                        .cpUTF8Value(fileName, false));
                classFile.attributes = new Attribute[] { (Attribute) cp
                        .add(sourceFileAttribute) };
            } else {
                classFile.attributes = new Attribute[] {};
View Full Code Here

        assertFalse(unequal.equals(equal1));
        assertFalse(unequal.equals(equal2));
    }

    public void testSourceAttribute() {
        SourceFileAttribute sfa1 = new SourceFileAttribute(new CPUTF8(
                new String("Thing.java"), 1)); //$NON-NLS-1$
        SourceFileAttribute sfa2 = new SourceFileAttribute(new CPUTF8(
                new String("Thing.java"), 1)); //$NON-NLS-1$
        SourceFileAttribute sfa3 = new SourceFileAttribute(new CPUTF8(
                new String("OtherThing.java"), 2)); //$NON-NLS-1$
        checkEquality(sfa1, sfa2, "Thing.java", sfa3); //$NON-NLS-1$
    }
View Full Code Here

TOP

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

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.