Package org.apache.harmony.pack200

Examples of org.apache.harmony.pack200.Segment$SegmentMethodVisitor


                       for (int k = 0; k < n; k++) {
                           long result = codec.decode(in);
                           exceptions[k] = new CPClass(cpBands.getCpClass()[(int) result]);
                       }
                   }
                   methodExceptions[i][j] = new ExceptionsAttribute(exceptions);
                   methodAttributes[i][j].add(methodExceptions[i][j]);
               }
            }
        }
    }
View Full Code Here


        .getAttributeLayout(AttributeLayout.ATTRIBUTE_SOURCE_FILE,
            AttributeLayout.CONTEXT_CLASS);
    if (SOURCE_FILE.matches(classBands.getClassFlags()[classNum])) {
      String fileName = fullName.substring(i) + ".java";
      classFile.attributes = new Attribute[] { (Attribute) cp
          .add(new SourceFileAttribute(fileName)) };
    } else {
      classFile.attributes = new Attribute[] {};
    }
    // this/superclass
    ClassFileEntry cfThis = cp.add(new CPClass(fullName));
View Full Code Here

    public void testJustResources() throws Exception {
        in = Segment.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/JustResources.pack");
        file = File.createTempFile("just", "resources.jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Segment segment = new Segment();
        segment.unpack(in, out);
    }
View Full Code Here

    public void testInterfaceOnly() throws Exception {
        in = Segment.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/InterfaceOnly.pack");
        file = File.createTempFile("Interface", "Only.jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Segment segment = new Segment();
        segment.unpack(in, out);
    }
View Full Code Here

    public void testHelloWorld() throws Exception {
        in = Segment.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/HelloWorld.pack");
        file = File.createTempFile("hello", "world.jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Segment segment = new Segment();
        segment.unpack(in, out);
        out.close();
        out = null;
        JarFile jarFile = new JarFile(file);
        file.deleteOnExit();
        JarEntry entry = jarFile
View Full Code Here

    public void testIndex() {
        pool.add(new CPUTF8("OtherThing", 1));
        CPUTF8 u1 = new CPUTF8("thing", 2);
        pool.add(u1);
        pool.resolve(new Segment());
        assertTrue(pool.indexOf(u1) > 0);
    }
View Full Code Here

    }

    public void testLayoutRU() throws Pack200Exception {
        AttributeLayout layout = new AttributeLayout("RU",
                AttributeLayout.CONTEXT_CLASS, "RU", 1);
        Segment segment = new TestSegment();
        assertNull(layout.getValue(-1, segment.getConstantPool()));
        assertEquals("Zero", ((CPUTF8)layout.getValue(0, segment.getConstantPool())).underlyingString());
        assertEquals("One", ((CPUTF8)layout.getValue(1, segment.getConstantPool())).underlyingString());
    }
View Full Code Here

    }

    public void testLayoutRUN() throws Pack200Exception {
        AttributeLayout layout = new AttributeLayout("RUN",
                AttributeLayout.CONTEXT_CLASS, "RUN", 1);
        Segment segment = new TestSegment();
        assertNull(layout.getValue(0, segment.getConstantPool()));
        assertEquals("Zero", ((CPUTF8)layout.getValue(1, segment.getConstantPool())).underlyingString());
        assertEquals("One", ((CPUTF8)layout.getValue(2, segment.getConstantPool())).underlyingString());
    }
View Full Code Here

    }

    public void testLayoutRS() throws Pack200Exception {
        AttributeLayout layout = new AttributeLayout("RS",
                AttributeLayout.CONTEXT_CLASS, "RS", 1);
        Segment segment = new TestSegment();
        assertNull(layout.getValue(-1, segment.getConstantPool()));
        assertEquals("Eins", ((CPUTF8)layout.getValue(0, segment.getConstantPool())).underlyingString());
        assertEquals("Zwei", ((CPUTF8)layout.getValue(1, segment.getConstantPool())).underlyingString());
    }
View Full Code Here

    }

    public void testLayoutRSN() throws Pack200Exception {
        AttributeLayout layout = new AttributeLayout("RSN",
                AttributeLayout.CONTEXT_CLASS, "RSN", 1);
        Segment segment = new TestSegment();
        assertNull(layout.getValue(0, segment.getConstantPool()));
        assertEquals("Eins", ((CPUTF8)layout.getValue(1, segment.getConstantPool())).underlyingString());
        assertEquals("Zwei", ((CPUTF8)layout.getValue(2, segment.getConstantPool())).underlyingString());
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.pack200.Segment$SegmentMethodVisitor

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.