Package org.apache.harmony.unpack200.bytecode

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


            }

            fileIsClass[i] = isClass;

            if (isClass) {
                ClassFile classFile = buildClassFile(classNum);
                classFile.write(dos);
                dos.flush();

                classFilesContents[classNum] = bos.toByteArray();
                bos.reset();
View Full Code Here


            cp.add(attrib);
            classFile.attributes[originalAttributes.length + index] = attrib;
        }

        // this/superclass
        ClassFileEntry cfThis = cp.add(cpBands.cpClassValue(fullNameIndexInCpClass));
        ClassFileEntry cfSuper = cp.add(cpBands.cpClassValue(classBands
                .getClassSuperInts()[classNum]));
        // add interfaces
        ClassFileEntry cfInterfaces[] = new ClassFileEntry[classBands
                .getClassInterfacesInts()[classNum].length];
        for (i = 0; i < cfInterfaces.length; i++) {
            cfInterfaces[i] = cp.add(cpBands.cpClassValue(classBands
                    .getClassInterfacesInts()[classNum][i]));
        }
        // add fields
        ClassFileEntry cfFields[] = new ClassFileEntry[classBands
                .getClassFieldCount()[classNum]];
        // 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(':');
View Full Code Here

    public void testMixedByteCodes() {
        OperandManager operandManager = new MockOperandManager();
        operandManager.setSegment(segment);
        operandManager.setCurrentClass("java/lang/Foo");

        CodeAttribute attribute = new CodeAttribute(3, // maxStack
                2, // maxLocals
                mixedByteArray, // codePacked
                segment, // segment
                operandManager, // operandManager
                new ArrayList());
View Full Code Here

    public void testSingleByteCodes() {
        OperandManager operandManager = new MockOperandManager();
        operandManager.setSegment(segment);
        operandManager.setCurrentClass("java/lang/Foo");

        CodeAttribute attribute = new CodeAttribute(4, // maxStack
                3, // maxLocals
                singleByteArray, // codePacked
                segment, // segment
                operandManager, // operandManager
                new ArrayList());
View Full Code Here

                            || type.equals("C") || type.equals("Z"))
                        type = "I";
                    ClassFileEntry value = constantValueLayout.getValue(result,
                            type, cpBands.getConstantPool());
                    fieldAttributes[i][j]
                            .add(new ConstantValueAttribute(value));
                    constantValueIndex++;
                }
                if (signatureLayout.matches(flag)) {
                    // we've got a signature attribute
                    long result = fieldSignatureRS[signatureIndex];
View Full Code Here

                            || type.equals("C") || type.equals("Z"))
                        type = "I";
                    ClassFileEntry value = constantValueLayout.getValue(result,
                            type, cpBands.getConstantPool());
                    fieldAttributes[i][j]
                            .add(new ConstantValueAttribute(value));
                    constantValueIndex++;
                }
                if (signatureLayout.matches(flag)) {
                    // we've got a signature attribute
                    long result = fieldSignatureRS[signatureIndex];
View Full Code Here

                            || type.equals("C") || type.equals("Z"))
                        type = "I";
                    ClassFileEntry value = constantValueLayout.getValue(result,
                            type, cpBands.getConstantPool());
                    fieldAttributes[i][j]
                            .add(new ConstantValueAttribute(value));
                    constantValueIndex++;
                }
                if (signatureLayout.matches(flag)) {
                    // we've got a signature attribute
                    long result = fieldSignatureRS[signatureIndex];
View Full Code Here

                            || type.equals("C") || type.equals("Z"))
                        type = "I";
                    ClassFileEntry value = constantValueLayout.getValue(result,
                            type, cpBands.getConstantPool());
                    fieldAttributes[i][j]
                            .add(new ConstantValueAttribute(value));
                    constantValueIndex++;
                }
                if (signatureLayout.matches(flag)) {
                    // we've got a signature attribute
                    long result = fieldSignatureRS[signatureIndex];
View Full Code Here

                            || type.equals("C") || type.equals("Z"))
                        type = "I";
                    ClassFileEntry value = constantValueLayout.getValue(result,
                            type, cpBands.getConstantPool());
                    fieldAttributes[i][j]
                            .add(new ConstantValueAttribute(value));
                    constantValueIndex++;
                }
                if (signatureLayout.matches(flag)) {
                    // we've got a signature attribute
                    long result = fieldSignatureRS[signatureIndex];
View Full Code Here

                            || type.equals("C") || type.equals("Z"))
                        type = "I";
                    ClassFileEntry value = constantValueLayout.getValue(result,
                            type, cpBands.getConstantPool());
                    fieldAttributes[i][j]
                            .add(new ConstantValueAttribute(value));
                    constantValueIndex++;
                }
                if (signatureLayout.matches(flag)) {
                    // we've got a signature attribute
                    long result = fieldSignatureRS[signatureIndex];
View Full Code Here

TOP

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

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.