harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r500983 - in /harmony/enhanced/classlib/trunk/modules/pack200: ./ .settings/ META-INF/ make/ src/main/java/org/apache/harmony/pack200/ src/main/java/org/apache/harmony/pack200/bytecode/ src/main/java5/ src/main/java5/org/ src/main/java5/org...
Date Mon, 29 Jan 2007 09:49:43 GMT
Author: ayza
Date: Mon Jan 29 01:49:41 2007
New Revision: 500983

URL: http://svn.apache.org/viewvc?view=rev&rev=500983
Log:
Big code update for pack200 module (HARMONY-2957)

Added:
    harmony/enhanced/classlib/trunk/modules/pack200/.settings/
    harmony/enhanced/classlib/trunk/modules/pack200/.settings/org.eclipse.jdt.core.prefs 
 (with props)
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java
  (with props)
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java
  (with props)
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200UnpackerAdapter.java
  (with props)
    harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java
  (with props)
Removed:
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Pack200Adapter.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Pack200PackerAdapter.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Pack200UnpackerAdapter.java
Modified:
    harmony/enhanced/classlib/trunk/modules/pack200/.classpath
    harmony/enhanced/classlib/trunk/modules/pack200/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/trunk/modules/pack200/build.xml
    harmony/enhanced/classlib/trunk/modules/pack200/make/exclude.common
    harmony/enhanced/classlib/trunk/modules/pack200/make/hyproperties.xml
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeLayout.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPString.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/SourceFileAttribute.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/SegmentTest.java

Modified: harmony/enhanced/classlib/trunk/modules/pack200/.classpath
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/.classpath?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/.classpath (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/.classpath Mon Jan 29 01:49:41 2007
@@ -1,9 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry output="bin/main" kind="src" path="src/main/java"/>
-	<classpathentry output="bin/test" kind="src" path="src/test/java"/>
-	<classpathentry output="bin/test" kind="src" path="src/test/resources"/>	
+	<classpathentry kind="src" output="bin/main" path="src/main/java"/>
+	<classpathentry kind="src" output="bin/test" path="src/test/java"/>
+	<classpathentry kind="src" output="bin/test" path="src/test/resources"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry sourcepath="JUNIT_SRC_HOME/junitsrc.zip" kind="var" path="JUNIT_HOME/junit.jar"/>
+	<classpathentry kind="var" path="JUNIT_HOME/junit.jar" sourcepath="JUNIT_SRC_HOME/junitsrc.zip"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+	<classpathentry exported="true" kind="lib" path="pack200-java5.jar"/>
 	<classpathentry kind="output" path="bin/main"/>
 </classpath>

Added: harmony/enhanced/classlib/trunk/modules/pack200/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/.settings/org.eclipse.jdt.core.prefs?view=auto&rev=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/.settings/org.eclipse.jdt.core.prefs (added)
+++ harmony/enhanced/classlib/trunk/modules/pack200/.settings/org.eclipse.jdt.core.prefs Mon
Jan 29 01:49:41 2007
@@ -0,0 +1,12 @@
+#Tue Jan 09 09:46:02 GMT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3

Propchange: harmony/enhanced/classlib/trunk/modules/pack200/.settings/org.eclipse.jdt.core.prefs
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/classlib/trunk/modules/pack200/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/META-INF/MANIFEST.MF?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/META-INF/MANIFEST.MF Mon Jan 29 01:49:41
2007
@@ -11,21 +11,12 @@
 Bundle-Version: 1.0.0
 Bundle-ClassPath: .
 Eclipse-JREBundle: true
-Import-Package: java.beans,
- java.io,
- java.lang,
- java.lang.ref,
- java.lang.reflect,
- java.net,
- java.nio,
- java.nio.charset,
- java.security,
- java.security.cert,
- java.util,
- javax.security.auth.x500,
- org.apache.harmony.luni.util,
- org.apache.harmony.security.utils,
- org.apache.harmony.kernel.vm
+Import-Package: java.io;resolution:=optional,
+ java.lang;resolution:=optional,
+ java.util;resolution:=optional,
+ java.util.jar;resolution:=optional
 Export-Package: org.apache.harmony.pack200,
  org.apache.harmony.pack200.bytecode
+Bundle-RequiredExecutionEnvironment: J2SE-1.4,
+ J2SE-1.5
 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/build.xml?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/build.xml Mon Jan 29 01:49:41 2007
@@ -34,6 +34,12 @@
                         from="^(.*?)(\$$[^/\\\.]*)?\.class$$"
                         to="\1.java"/>
             </present>
+            <present targetdir="${hy.pack200.src.main.java5}" />
+            <present targetdir="${hy.pack200.src.main.java5}">
+                <mapper type="regexp"
+                        from="^(.*?)(\$$[^/\\\.]*)?\.class$$"
+                        to="\1.java"/>
+            </present>
         </or>
     </fileset>
 
@@ -71,6 +77,7 @@
 
         <mkdir dir="${hy.build}" />
 
+    	<!-- Ordinary classes -->
         <javac sourcepath=""
                srcdir="${hy.pack200.src.main.java}"
                destdir="${hy.build}"
@@ -88,6 +95,24 @@
                 </fileset>
             </bootclasspath>
         </javac>
+    	<!-- Java5 classes, with generics -->
+        <javac sourcepath=""
+               srcdir="${hy.pack200.src.main.java5}"
+               destdir="${hy.build}"
+               compiler="${hy.javac.compiler}"
+               memoryMaximumSize="${hy.javac.maxmem}"
+               source="${hy.javac.source}"
+               target="${hy.javac.target}"
+               debug="${hy.javac.debug}">
+
+            <compilerarg line="${build.compilerarg}" />
+
+            <bootclasspath>
+                <fileset dir="${hy.jdk}/jre/lib/boot">
+                    <include name="**/*.jar" />
+                </fileset>
+            </bootclasspath>
+        </javac>
     </target>
 
     <target name="copy-resources">
@@ -112,6 +137,7 @@
 
         <jar destfile="${hy.jdk}/jre/lib/boot/pack200-src.jar">
             <fileset dir="${hy.pack200.src.main.java}" />
+            <fileset dir="${hy.pack200.src.main.java}/../java5" />
             <manifest>
                 <attribute name="Implementation-Version" value="${svn.info}"/> 
             </manifest>

Modified: harmony/enhanced/classlib/trunk/modules/pack200/make/exclude.common
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/make/exclude.common?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/make/exclude.common (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/make/exclude.common Mon Jan 29 01:49:41
2007
@@ -1 +0,0 @@
-org/apache/harmony/pack200/tests/SegmentTest.java
\ No newline at end of file

Modified: harmony/enhanced/classlib/trunk/modules/pack200/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/make/hyproperties.xml?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/make/hyproperties.xml Mon Jan 29 01:49:41
2007
@@ -21,6 +21,7 @@
       <src>
          <main>
             <java location="src/main/java" />
+            <java5 location="src/main/java5" />
          </main>
          <test>
             <java location="src/test/java" />
@@ -34,8 +35,8 @@
       <packaging>
       </packaging>
       <javac>
-        <source>1.5</source>
-        <target>1.5</target>
+        <source>1.4</source>
+        <target>1.4</target>
       </javac>
    </pack200>
 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeLayout.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeLayout.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeLayout.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeLayout.java
Mon Jan 29 01:49:41 2007
@@ -40,7 +40,7 @@
 
 		private String name;
 
-		@Override
+		
 		public int hashCode() {
 			final int PRIME = 31;
 			int result = 1;
@@ -49,7 +49,7 @@
 			return result;
 		}
 
-		@Override
+		
 		public boolean equals(Object obj) {
 			if (this == obj)
 				return true;
@@ -238,7 +238,7 @@
 		return (value & mask) != 0;
 	}
 
-	@Override
+	
 	public boolean equals(Object obj) {
 		if (this == obj)
 			return true;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java
Mon Jan 29 01:49:41 2007
@@ -134,7 +134,7 @@
 		}
 	}
 
-	@Override
+	
 	public long decode(InputStream in) throws IOException, Pack200Exception {
 		if (d != 0)
 			throw new Pack200Exception(
@@ -142,7 +142,7 @@
 		return decode(in, 0);
 	}
 
-	@Override
+	
 	public long decode(InputStream in, long last) throws IOException,
 			Pack200Exception {
 		int n = 0;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java
Mon Jan 29 01:49:41 2007
@@ -41,18 +41,18 @@
 		this.unvafouredCodec = unvafouredCodec;
 	}
 
-	@Override
+	
 	public long decode(InputStream in) throws IOException, Pack200Exception {
 		throw new Pack200Exception("Population encoding does not work unless the number of elements
are known");
 	}
 
-	@Override
+	
 	public long decode(InputStream in, long last) throws IOException,
 			Pack200Exception {
 		throw new Pack200Exception("Population encoding does not work unless the number of elements
are known");
 	}
 
-	@Override
+	
 	public long[] decode(int n, InputStream in) throws IOException, Pack200Exception {
 		long favoured[] =new long[n]; // there must be <= n  values, but probably a lot less
 		long result[];

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?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- 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 Jan 29 01:49:41 2007
@@ -392,7 +392,6 @@
 	 * @param message
 	 * @deprecated this should be removed from production code
 	 */
-	@Deprecated
 	private void debug(String message) {
 		if (System.getProperty("debug.pack200") != null) {
 			System.err.println(message);

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java
Mon Jan 29 01:49:41 2007
@@ -29,7 +29,6 @@
 		this.attributeName = new CPUTF8(attributeName);
 	}
 
-	@Override
 	public boolean equals(Object obj) {
 		if (this == obj)
 			return true;
@@ -52,7 +51,7 @@
 
 	protected abstract int getLength();
 
-	@Override
+	
 	public int hashCode() {
 		final int PRIME = 31;
 		int result = 1;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java
Mon Jan 29 01:49:41 2007
@@ -33,7 +33,7 @@
 		this.utf8 = new CPUTF8(name);
 	}
 
-	@Override
+	
 	public boolean equals(Object obj) {
 		if (this == obj)
 			return true;
@@ -59,7 +59,7 @@
 		return new ClassFileEntry[] { utf8, };
 	}
 
-	@Override
+	
 	public int hashCode() {
 		final int PRIME = 31;
 		int result = 1;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java
Mon Jan 29 01:49:41 2007
@@ -26,7 +26,7 @@
 		this.value = value;
 	}
 
-	@Override
+	
 	public boolean equals(Object obj) {
 		if (this == obj)
 			return true;
@@ -43,7 +43,7 @@
 		return true;
 	}
 
-	@Override
+	
 	public int hashCode() {
 		final int PRIME = 31;
 		int result = 1;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java
Mon Jan 29 01:49:41 2007
@@ -24,12 +24,12 @@
 		super(ConstantPoolEntry.CP_Double,value);
 	}
 
-	@Override
+	
 	protected void writeBody(DataOutputStream dos) throws IOException {
 		dos.writeDouble(getNumber().doubleValue());
 	}
 
-	@Override
+	
 	public String toString() {
 		return "Double: " + getValue();
 	}

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java
Mon Jan 29 01:49:41 2007
@@ -35,7 +35,7 @@
 	}
 
 
-	@Override
+	
 	protected ClassFileEntry[] getNestedClassFileEntries() {
 		ClassFileEntry[] entries = new ClassFileEntry[2];
 		entries[0] = className;
@@ -44,7 +44,7 @@
 	}
 
 
-	@Override
+	
 	protected void resolve(ClassConstantPool pool) {
 		super.resolve(pool);
 		nameAndTypeIndex = pool.indexOf(nameAndType);
@@ -56,13 +56,13 @@
 		dos.writeShort(nameAndTypeIndex);
 	}
 
-	@Override
+	
 	public String toString() {
 		return "FieldRef: " + className + "#" + nameAndType;
 	}
 
 
-	@Override
+	
 	public int hashCode() {
 		final int PRIME = 31;
 		int result = 1;
@@ -72,7 +72,7 @@
 	}
 
 
-	@Override
+	
 	public boolean equals(Object obj) {
 		if (this == obj)
 			return true;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java
Mon Jan 29 01:49:41 2007
@@ -24,12 +24,12 @@
 		super(ConstantPoolEntry.CP_Float,value);
 	}
 
-	@Override
+	
 	protected void writeBody(DataOutputStream dos) throws IOException {
 		dos.writeFloat(getNumber().floatValue());
 	}
 
-	@Override
+	
 	public String toString() {
 		return "Float: " + getValue();
 	}

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java
Mon Jan 29 01:49:41 2007
@@ -25,12 +25,12 @@
 		super(ConstantPoolEntry.CP_Integer,value);
 	}
 
-	@Override
+	
 	protected void writeBody(DataOutputStream dos) throws IOException {
 		dos.writeInt(getNumber().intValue());
 	}
 
-	@Override
+	
 	public String toString() {
 		return "Integer: " + getValue();
 	}

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java
Mon Jan 29 01:49:41 2007
@@ -25,12 +25,12 @@
 		super(ConstantPoolEntry.CP_Long,value);
 	}
 
-	@Override
+	
 	protected void writeBody(DataOutputStream dos) throws IOException {
 		dos.writeLong(getNumber().longValue());
 	}
 
-	@Override
+	
 	public String toString() {
 		return "Long: " + getValue();
 	}

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java
Mon Jan 29 01:49:41 2007
@@ -45,7 +45,7 @@
 	}
 
 
-	@Override
+	
 	protected ClassFileEntry[] getNestedClassFileEntries() {
 		int attributeCount = attributes.size();
 		ClassFileEntry[] entries = new ClassFileEntry[attributeCount+2];
@@ -58,7 +58,7 @@
 	}
 
 
-	@Override
+	
 	protected void resolve(ClassConstantPool pool) {
 		super.resolve(pool);
 		nameIndex = pool.indexOf(name);
@@ -69,12 +69,12 @@
 		}
 	}
 
-	@Override
+	
 	public String toString() {
 		return "Field: " + name + "(" + descriptor + ")";
 	}
 
-	@Override
+	
 	public int hashCode() {
 		final int PRIME = 31;
 		int result = 1;
@@ -86,7 +86,7 @@
 	}
 
 
-	@Override
+	
 	public boolean equals(Object obj) {
 		if (this == obj)
 			return true;
@@ -116,7 +116,7 @@
 	}
 
 
-	@Override
+	
 	protected void doWrite(DataOutputStream dos) throws IOException {
 		dos.writeShort(flags);
 		dos.writeShort(nameIndex);

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java
Mon Jan 29 01:49:41 2007
@@ -37,7 +37,7 @@
 		this.descriptor = new CPUTF8(descriptor.substring(colon+1));
 	}
 
-	@Override
+	
 	protected void resolve(ClassConstantPool pool) {
 		super.resolve(pool);
 		descriptorIndex = pool.indexOf(descriptor);
@@ -48,18 +48,18 @@
 	 * field_info { u2 access_flags; u2 name_index; u2 descriptor_index; u2
 	 * attributes_count; attribute_info attributes[attributes_count]; }
 	 */
-	@Override
+	
 	protected void writeBody(DataOutputStream dos) throws IOException {
 		dos.writeShort(nameIndex);
 		dos.writeShort(descriptorIndex);
 	}
 
-	@Override
+	
 	public String toString() {
 		return "NameAndType: " + name + "(" + descriptor + ")";
 	}
 
-	@Override
+	
 	public int hashCode() {
 		final int PRIME = 31;
 		int result = 1;
@@ -68,7 +68,7 @@
 		return result;
 	}
 
-	@Override
+	
 	public boolean equals(Object obj) {
 		if (this == obj)
 			return true;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPString.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPString.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPString.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPString.java
Mon Jan 29 01:49:41 2007
@@ -29,12 +29,12 @@
 
 	}
 
-	@Override
+	
 	protected void writeBody(DataOutputStream dos) throws IOException {
 		dos.writeShort(nameIndex);
 	}
 
-	@Override
+	
 	public String toString() {
 		return "String: " + getValue();
 	}

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java
Mon Jan 29 01:49:41 2007
@@ -28,7 +28,7 @@
 		this.utf8 = utf8;
 	}
 
-	@Override
+	
 	public boolean equals(Object obj) {
 		if (this == obj)
 			return true;
@@ -45,7 +45,7 @@
 		return true;
 	}
 
-	@Override
+	
 	public int hashCode() {
 		final int PRIME = 31;
 		int result = 1;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java
Mon Jan 29 01:49:41 2007
@@ -41,7 +41,7 @@
 		}
 	}
 
-	@Override
+	
 	public boolean equals(Object obj) {
 		if (this == obj)
 			return true;
@@ -58,7 +58,7 @@
 		return true;
 	}
 
-	@Override
+	
 	protected int getLength() {
 		return 2;
 	}
@@ -67,7 +67,7 @@
 		return new ClassFileEntry[] { getAttributeName(), entry };
 	}
 
-	@Override
+	
 	public int hashCode() {
 		final int PRIME = 31;
 		int result = super.hashCode();
@@ -85,7 +85,7 @@
 		return "Constant:" + entry;
 	}
 
-	@Override
+	
 	protected void writeBody(DataOutputStream dos) throws IOException {
 		dos.writeShort(constantIndex);
 	}

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java
Mon Jan 29 01:49:41 2007
@@ -22,6 +22,19 @@
 
 public class ExceptionsAttribute extends Attribute {
 
+	private static int hashCode(Object[] array) {
+		final int prime = 31;
+		if (array == null)
+			return 0;
+		int result = 1;
+		for (int index = 0; index < array.length; index++) {
+			result = prime * result
+					+ (array[index] == null ? 0 : array[index].hashCode());
+		}
+		return result;
+	}
+
+
 	private transient int[] exceptionIndexes;
 
 	private CPClass[] exceptions;
@@ -31,7 +44,7 @@
 		this.exceptions = exceptions;
 	}
 
-	@Override
+	
 	public boolean equals(Object obj) {
 		if (this == obj)
 			return true;
@@ -45,7 +58,7 @@
 		return true;
 	}
 
-	@Override
+	
 	protected int getLength() {
 		return 2 + 2 * exceptions.length;
 	}
@@ -59,11 +72,11 @@
 		return result;
 	}
 
-	@Override
+	
 	public int hashCode() {
-		final int PRIME = 31;
+		final int prime = 31;
 		int result = super.hashCode();
-		result = PRIME * result + Arrays.hashCode(exceptions);
+		result = prime * result + ExceptionsAttribute.hashCode(exceptions);
 		return result;
 	}
 
@@ -80,7 +93,7 @@
 		return "Exceptions:" + exceptions;
 	}
 
-	@Override
+	
 	protected void writeBody(DataOutputStream dos) throws IOException {
 		dos.writeShort(exceptionIndexes.length);
 		for (int i = 0; i < exceptionIndexes.length; i++) {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/SourceFileAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/SourceFileAttribute.java?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/SourceFileAttribute.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/SourceFileAttribute.java
Mon Jan 29 01:49:41 2007
@@ -30,7 +30,6 @@
 		this.name = new CPUTF8(name);
 	}
 
-	@Override
 	public boolean equals(Object obj) {
 		if (this == obj)
 			return true;
@@ -47,7 +46,6 @@
 		return true;
 	}
 
-	@Override
 	protected int getLength() {
 		return 2;
 	}
@@ -56,7 +54,6 @@
 		return new ClassFileEntry[] { getAttributeName(), name };
 	}
 
-	@Override
 	public int hashCode() {
 		final int PRIME = 31;
 		int result = super.hashCode();

Added: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java?view=auto&rev=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java
Mon Jan 29 01:49:41 2007
@@ -0,0 +1,59 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.harmony.pack200;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * Provides generic JavaBeans support for the Pack/UnpackAdapters
+ */
+public abstract class Pack200Adapter {
+
+	protected static final int DEFAULT_BUFFER_SIZE = 8192;
+
+	private PropertyChangeSupport support = new PropertyChangeSupport(this);
+
+	private SortedMap<String, String> properties = new TreeMap<String, String>();
+
+	public SortedMap<String, String> properties() {
+		return properties;
+	}
+
+	public void addPropertyChangeListener(PropertyChangeListener listener) {
+		support.addPropertyChangeListener(listener);
+	}
+
+	protected void firePropertyChange(String propertyName, Object oldValue,
+			Object newValue) {
+		support.firePropertyChange(propertyName, oldValue, newValue);
+	}
+
+	public void removePropertyChangeListener(PropertyChangeListener listener) {
+		support.removePropertyChangeListener(listener);
+	}
+
+	/** 
+	 * Completion between 0..1
+	 * @param value
+	 */
+	protected void completed(double value) {
+		firePropertyChange("pack.progress", null, String.valueOf((int)(100*value))); //$NON-NLS-1$
+	}
+}

Propchange: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java?view=auto&rev=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java
Mon Jan 29 01:49:41 2007
@@ -0,0 +1,42 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.harmony.pack200;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.jar.JarFile;
+import java.util.jar.JarInputStream;
+import java.util.jar.Pack200.Packer;
+
+
+/**
+ * This class provides the binding between the standard Pack200 interface and the
+ * internal interface for (un)packing. As this uses generics for the SortedMap,
+ * this class must be compiled and run on a Java 1.5 system. However, Java 1.5
+ * is not necessary to use the internal libraries for unpacking.
+ */
+public class Pack200PackerAdapter extends Pack200Adapter implements Packer {
+
+	public void pack(JarFile arg0, OutputStream arg1) throws IOException {
+		throw new Error("Not yet implemented");
+	}
+
+	public void pack(JarInputStream arg0, OutputStream arg1) throws IOException {
+		throw new Error("Not yet implemented");
+	}
+
+}

Propchange: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200UnpackerAdapter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200UnpackerAdapter.java?view=auto&rev=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200UnpackerAdapter.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200UnpackerAdapter.java
Mon Jan 29 01:49:41 2007
@@ -0,0 +1,78 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.harmony.pack200;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Pack200.Unpacker;
+
+import org.apache.harmony.pack200.Pack200Exception;
+import org.apache.harmony.pack200.Segment;
+
+/**
+ * This class provides the binding between the standard Pack200 interface and
+ * the internal interface for (un)packing. As this uses generics for the
+ * SortedMap, this class must be compiled and run on a Java 1.5 system. However,
+ * Java 1.5 is not necessary to use the internal libraries for unpacking.
+ */
+public class Pack200UnpackerAdapter extends Pack200Adapter implements Unpacker {
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see java.util.jar.Pack200.Unpacker#unpack(java.io.InputStream,
+	 *      java.util.jar.JarOutputStream)
+	 */
+	public void unpack(InputStream in, JarOutputStream out) throws IOException {
+		if (in == null || out == null)
+			throw new IllegalArgumentException(
+					"Must specify both input and output streams");
+		completed(0);
+		try {
+			while (in.available() > 0) {
+				Segment s = Segment.parse(in);
+				s.writeJar(out, in);
+				out.flush();
+			}
+		} catch (Pack200Exception e) {
+			throw new IOException("Failed to unpack Jar:" + String.valueOf(e));
+		}
+		completed(1);
+		in.close();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see java.util.jar.Pack200.Unpacker#unpack(java.io.File,
+	 *      java.util.jar.JarOutputStream)
+	 */
+	public void unpack(File file, JarOutputStream out) throws IOException {
+		if (file == null || out == null)
+			throw new IllegalArgumentException(
+					"Must specify both input and output streams");
+		int size = (int) file.length();
+		int bufferSize = (size > 0 && size < DEFAULT_BUFFER_SIZE ? size
+				: DEFAULT_BUFFER_SIZE);
+		InputStream in = new BufferedInputStream(new FileInputStream(file),
+				bufferSize);
+		unpack(in, out);
+	}
+}

Propchange: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200UnpackerAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java?view=auto&rev=500983
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java
Mon Jan 29 01:49:41 2007
@@ -0,0 +1,62 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.harmony.pack200.tests;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.apache.harmony.pack200.Segment;
+
+public class ClassVersionTest extends TestCase {
+	public void testCorrectVersionOfSegment() throws IOException {
+		InputStream in = Segment.class.getResourceAsStream(
+                "/org/apache/harmony/pack200/Segment.class");
+		DataInputStream din = new DataInputStream(in);
+
+        assertEquals(0xCAFEBABE,din.readInt());
+		din.readShort(); // MINOR -- don't care
+		assertTrue("Class file has been compiled with Java 1.5 compatibility" +
+                " instead of 1.4 or lower",din.readShort() < 49); // 49 = Java 1.5 
+	}
+
+    public void testCorrectVersionOfTest() throws IOException {
+		InputStream in = Segment.class.getResourceAsStream(
+                "/org/apache/harmony/pack200/tests/ClassVersionTest.class");
+		DataInputStream din = new DataInputStream(in);
+
+        assertEquals(0xCAFEBABE,din.readInt());
+		din.readShort(); // MINOR -- don't care
+		assertTrue("Class file has been compiled with Java 1.5 compatibility" +
+                " instead of 1.4 or lower",din.readShort() < 49); // 49 = Java 1.5 
+	}
+
+    public void testCorrectVersionOfAdapter() throws IOException {
+		// tests that both the file is on the classpath and that it's been
+        // compiled correctly, but without actually loading the class
+		InputStream in = Segment.class.getResourceAsStream(
+                "/org/apache/harmony/pack200/Pack200Adapter.class");
+		DataInputStream din = new DataInputStream(in);
+
+        assertEquals(0xCAFEBABE,din.readInt());
+		din.readShort(); // MINOR -- don't care
+		assertTrue("Class file needs 1.5 compatibility",
+                din.readShort() >= 49); // 49 = Java 1.5 
+	}
+}

Propchange: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

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?view=diff&rev=500983&r1=500982&r2=500983
==============================================================================
--- 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 Jan 29 01:49:41 2007
@@ -35,7 +35,7 @@
 // Will be uncommented later     
 //	public void testHelloWorld() throws Exception {
 //		assertNotNull(Segment.parse(Segment.class
-//				.getResourceAsStream("/org/apache/harmony/archive/tests/internal/pack200/HelloWorld.pack")));
+//				.getResourceAsStream("/org/apache/harmony/pack200/tests/HelloWorld.pack")));
 //	}
 	/**
 	 * @param args
@@ -43,7 +43,7 @@
 	 */
 	public void testJustResources() throws Exception {
 		assertNotNull(Segment.parse(Segment.class
-				.getResourceAsStream("/org/apache/harmony/archive/tests/internal/pack200/JustResources.pack")));
+				.getResourceAsStream("/org/apache/harmony/pack200/tests/JustResources.pack")));
 	}
 
 }



Mime
View raw message