harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r620466 - in /harmony/enhanced/classlib/trunk/modules/pack200/src: main/java/org/apache/harmony/pack200/Archive.java main/java/org/apache/harmony/pack200/Segment.java test/java/org/apache/harmony/pack200/tests/SegmentTest.java
Date Mon, 11 Feb 2008 11:45:34 GMT
Author: sjanuary
Date: Mon Feb 11 03:45:23 2008
New Revision: 620466

URL: http://svn.apache.org/viewvc?rev=620466&view=rev
Log:
Reverting some changes that were overwritten by HARMONY-5456

Modified:
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/SegmentTest.java

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java?rev=620466&r1=620465&r2=620466&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java
Mon Feb 11 03:45:23 2008
@@ -183,7 +183,6 @@
         } else if (logLevel == LOG_LEVEL_QUIET) {
             logLevel = LOG_LEVEL_QUIET;
         }
-        ;
     }
 
     public void setLogFile(String logFileName) throws FileNotFoundException {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java?rev=620466&r1=620465&r2=620466&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java
Mon Feb 11 03:45:23 2008
@@ -71,6 +71,8 @@
 
 
 	/**
+     * TODO: Do we need this method now we have Archive as the main entry point?
+     *
 	 * Decode a segment from the given input stream. This does not attempt to
 	 * re-assemble or export any class files, but it contains enough information
 	 * to be able to re-assemble class files by external callers.
@@ -87,19 +89,6 @@
 	public static Segment parse(InputStream in) throws IOException,
 			Pack200Exception {
 		Segment segment = new Segment();
-		// See if file is GZip compressed
-		if (!in.markSupported()) {
-			in = new BufferedInputStream(in);
-			if (!in.markSupported())
-				throw new IllegalStateException();
-		}
-		in.mark(2);
-		if (((in.read() & 0xFF) | (in.read() & 0xFF) << 8) == GZIPInputStream.GZIP_MAGIC)
{
-			in.reset();
-			in = new BufferedInputStream(new GZIPInputStream(in));
-		} else {
-			in.reset();
-		}
         segment.parseSegment(in);
 		return segment;
 	}

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/SegmentTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/SegmentTest.java?rev=620466&r1=620465&r2=620466&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/SegmentTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/SegmentTest.java
Mon Feb 11 03:45:23 2008
@@ -65,69 +65,7 @@
         segment.writeJar(out);
     }
 
-    // Test with an archive containing Harmony's SQL module, packed with -E1
-    public void testWithSqlE1() throws Exception {
-        in = Segment.class
-                .getResourceAsStream("/org/apache/harmony/pack200/tests/sql-e1.pack.gz");
-        Segment segment = Segment.parse(in);
-        assertNotNull(segment);
-        out = new JarOutputStream(new FileOutputStream(File.createTempFile("sql", "-e1.jar")));
-        segment.writeJar(out);
-    }
-
-    // Test with an archive containing Harmony's SQL module
-    public void testWithSql() throws Exception {
-        in = Segment.class
-                .getResourceAsStream("/org/apache/harmony/pack200/tests/sql.pack.gz");
-        Segment segment = Segment.parse(in);
-        assertNotNull(segment);
-        out = new JarOutputStream(new FileOutputStream(File.createTempFile("sql", ".jar")));
-        segment.writeJar(out);
-    }
-
-    // Test with an archive containing Harmony's Pack200 module, packed with -E1
-    public void testWithPack200E1() throws Exception {
-        in = Segment.class
-                .getResourceAsStream("/org/apache/harmony/pack200/tests/pack200-e1.pack.gz");
-        Segment segment = Segment.parse(in);
-        assertNotNull(segment);
-        out = new JarOutputStream(new FileOutputStream(File.createTempFile("pack", "200-e1.jar")));
-        segment.writeJar(out);
-    }
-
-    // Test with an archive containing Harmony's Pack200 module
-    public void testWithPack200() throws Exception {
-        in = Segment.class
-                .getResourceAsStream("/org/apache/harmony/pack200/tests/pack200.pack.gz");
-        Segment segment = Segment.parse(in);
-        assertNotNull(segment);
-        out = new JarOutputStream(new FileOutputStream(File.createTempFile("pack", "200.jar")));
-        segment.writeJar(out);
-    }
-
-    // Test with an archive containing Harmony's JNDI module
-    public void testWithJNDIE1() throws Exception {
-        in = Segment.class
-                .getResourceAsStream("/org/apache/harmony/pack200/tests/jndi-e1.pack.gz");
-        Segment segment = Segment.parse(in);
-        assertNotNull(segment);
-        out = new JarOutputStream(new FileOutputStream(File.createTempFile("jndi", "-e1.jar")));
-        segment.writeJar(out);
-    }
-
-    // Test with an archive containing Annotations
-    public void testWithAnnotations() throws Exception {
-
-        in = Segment.class
-                .getResourceAsStream("/org/apache/harmony/pack200/tests/annotations.pack.gz");
-        Segment segment = Segment.parse(in);
-        assertNotNull(segment);
-        out = new JarOutputStream(new FileOutputStream(File.createTempFile("ann", "otations.jar")));
-        segment.writeJar(out);
-
-    }
-
-    public void testInterfaceOnly() throws Exception {
+     public void testInterfaceOnly() throws Exception {
         in = Segment.class
                 .getResourceAsStream("/org/apache/harmony/pack200/tests/InterfaceOnly.pack");
         Segment segment = Segment.parse(in);



Mime
View raw message