harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qi...@apache.org
Subject svn commit: r791082 [4/8] - in /harmony/enhanced/classlib/branches/java6: ./ depends/build/ depends/build/platform/ depends/manifests/asm-3.1/ make/ modules/accessibility/ modules/accessibility/make/ modules/accessibility/src/main/java/javax/accessibil...
Date Sat, 04 Jul 2009 08:38:24 GMT
Modified: harmony/enhanced/classlib/branches/java6/modules/math/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/build.xml Sat Jul  4 08:38:13 2009
@@ -23,6 +23,8 @@
     <property name="hy.hdk" location="${basedir}/../../deploy" />
     <import file="${hy.hdk}/build/ant/properties.xml" />
 
+    <property name="tests.output" location="../../build/test_report" />
+
     <!-- set global properties for this build. -->
     <xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
 
@@ -151,7 +153,7 @@
 
     <target name="run-tests">
 
-        <mkdir dir="${hy.tests.reports}" />
+        <mkdir dir="${tests.output}" />
 
         <property name="test.jre.home" value="${hy.jdk}/jre" />
 
@@ -178,7 +180,7 @@
 
             <formatter type="xml" />
 
-            <batchtest todir="${hy.tests.reports}" haltonfailure="no" >
+            <batchtest todir="${tests.output}" haltonfailure="no" >
 
                 <fileset dir="${hy.math.src.test.java}">
                     <!-- if ${test.case}     -->
@@ -194,12 +196,12 @@
     </target>
 
     <target name="touch-failures-file" if="test.failures">
-        <echo file="${hy.tests.reports}/test.failures"
+        <echo file="${tests.output}/test.failures"
             append="true">math${line.separator}</echo>
     </target>
 
     <target name="touch-errors-file" if="test.errors">
-        <echo file="${hy.tests.reports}/test.errors"
+        <echo file="${tests.output}/test.errors"
             append="true">math${line.separator}</echo>
     </target>
 

Modified: harmony/enhanced/classlib/branches/java6/modules/math/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/make/hyproperties.xml Sat Jul  4 08:38:13 2009
@@ -41,7 +41,4 @@
    <jdk location="../../deploy/jdk" />
    <build location="../../build/classes" />
 
-   <tests>
-      <reports location="../../build/test_report" />
-   </tests>
 </hy>

Modified: harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigDecimal.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigDecimal.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigDecimal.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigDecimal.java Sat Jul  4 08:38:13 2009
@@ -2299,7 +2299,7 @@
         int begin = (getUnscaledValue().signum() < 0) ? 2 : 1;
         int end = intString.length();
         long exponent = -(long)scale + end - begin;
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         result.append(intString);
         if ((scale > 0) && (exponent >= -6)) {
@@ -2344,7 +2344,7 @@
         int begin = (getUnscaledValue().signum() < 0) ? 2 : 1;
         int end = intString.length();
         long exponent = -(long)scale + end - begin;
-        StringBuffer result = new StringBuffer(intString);
+        StringBuilder result = new StringBuilder(intString);
 
         if ((scale > 0) && (exponent >= -6)) {
             if (exponent >= 0) {
@@ -2413,7 +2413,7 @@
         int begin = (signum() < 0) ? 1 : 0;
         int delta = scale;
         // We take space for all digits, plus a possible decimal point, plus 'scale'
-        StringBuffer result = new StringBuffer(intStr.length() + 1 + Math.abs(scale));
+        StringBuilder result = new StringBuilder(intStr.length() + 1 + Math.abs(scale));
 
         if (begin == 1) {
             // If the number is negative, we insert a '-' character at front 

Modified: harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/Conversion.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/Conversion.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/Conversion.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/Conversion.java Sat Jul  4 08:38:13 2009
@@ -158,7 +158,7 @@
                 case 6:
                     return "0.000000"; //$NON-NLS-1$
                 default:
-                    StringBuffer result1 = new StringBuffer();
+                    StringBuilder result1 = new StringBuilder();
                     if (scale < 0) {
                         result1.append("0E+"); //$NON-NLS-1$
                     } else {
@@ -270,7 +270,7 @@
         }
         int startPoint = currentChar + 1;
         int endPoint = resLengthInChars;
-        StringBuffer result1 = new StringBuffer(16 + endPoint - startPoint);
+        StringBuilder result1 = new StringBuilder(16 + endPoint - startPoint);
         if (negNumber) {
             result1.append('-');
         }
@@ -310,7 +310,7 @@
                 case 5: return "0.00000"; //$NON-NLS-1$
                 case 6: return "0.000000"; //$NON-NLS-1$
                 default:
-                    StringBuffer result1 = new StringBuffer();
+                    StringBuilder result1 = new StringBuilder();
                     if (scale  < 0) {
                         result1.append("0E+"); //$NON-NLS-1$
                     } else {
@@ -370,7 +370,7 @@
         }
         int startPoint = currentChar + 1;
         int endPoint = resLengthInChars;
-        StringBuffer result1 = new StringBuffer(16+endPoint-startPoint);
+        StringBuilder result1 = new StringBuilder(16+endPoint-startPoint);
         if (negNumber) {
             result1.append('-');
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/MathContext.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/MathContext.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/MathContext.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/MathContext.java Sat Jul  4 08:38:13 2009
@@ -293,7 +293,7 @@
      */
     @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer(45);
+        StringBuilder sb = new StringBuilder(45);
 
         sb.append(chPrecision);
         sb.append(precision);

Modified: harmony/enhanced/classlib/branches/java6/modules/misc/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/misc/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/misc/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/misc/build.xml Sat Jul  4 08:38:13 2009
@@ -23,6 +23,8 @@
     <property name="hy.hdk" location="${basedir}/../../deploy" />
     <import file="${hy.hdk}/build/ant/properties.xml" />
 
+    <property name="tests.output" location="../../build/test_report" />
+
     <!-- set global properties for this build. -->
     <xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
 
@@ -178,7 +180,7 @@
     </target>
 
     <target name="run-tests">
-        <mkdir dir="${hy.tests.reports}" />
+        <mkdir dir="${tests.output}" />
 
         <property name="test.jre.home" value="${hy.jdk}/jre" />
         <junit fork="yes"
@@ -205,7 +207,7 @@
 
             <formatter type="xml" />
 
-            <batchtest todir="${hy.tests.reports}" haltonfailure="no" >
+            <batchtest todir="${tests.output}" haltonfailure="no" >
 
                 <fileset dir="${hy.misc.src.test.java}">
                     <!-- if ${test.case}     -->
@@ -221,12 +223,12 @@
     </target>
 
     <target name="touch-failures-file" if="test.failures">
-        <echo file="${hy.tests.reports}/test.failures"
+        <echo file="${tests.output}/test.failures"
             append="true">misc${line.separator}</echo>
     </target>
 
     <target name="touch-errors-file" if="test.errors">
-        <echo file="${hy.tests.reports}/test.errors"
+        <echo file="${tests.output}/test.errors"
             append="true">misc${line.separator}</echo>
     </target>
 

Modified: harmony/enhanced/classlib/branches/java6/modules/misc/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/misc/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/misc/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/misc/make/hyproperties.xml Sat Jul  4 08:38:13 2009
@@ -43,7 +43,4 @@
    <jdk location="../../deploy/jdk" />
    <build location="../../build/classes" />
 
-   <tests>
-      <reports location="../../build/test_report" />
-   </tests>
 </hy>

Modified: harmony/enhanced/classlib/branches/java6/modules/misc/src/main/native/accessors/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/misc/src/main/native/accessors/unix/makefile?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/misc/src/main/native/accessors/unix/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/misc/src/main/native/accessors/unix/makefile Sat Jul  4 08:38:13 2009
@@ -28,7 +28,7 @@
 MDLLIBFILES += $(LIBPATH)libhyzip.a $(MDLLIBZLIB)
 endif
 
-MDLLIBFILES += $(LIBPATH)libhypool.a $(LIBPATH)libhyfdlibm.a \
+MDLLIBFILES += $(LIBPATH)libhypool.a \
 	$(LIBPATH)libvmi$(HY_LINKLIB_SUFFIX)
 
 DLLNAME=../libaccessors$(HY_SHLIB_SUFFIX)

Modified: harmony/enhanced/classlib/branches/java6/modules/misc/src/main/native/accessors/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/misc/src/main/native/accessors/windows/makefile?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/misc/src/main/native/accessors/windows/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/misc/src/main/native/accessors/windows/makefile Sat Jul  4 08:38:13 2009
@@ -30,7 +30,7 @@
 SYSLIBFILES = ws2_32.lib Iphlpapi.lib
 
 MDLLIBFILES = $(MDLLIBFILES) \
-  $(LIBPATH)hypool$(HY_LINKLIB_SUFFIX) $(LIBPATH)hyfdlibm$(HY_LINKLIB_SUFFIX) $(LIBPATH)vmi$(HY_LINKLIB_SUFFIX)
+  $(LIBPATH)hypool$(HY_LINKLIB_SUFFIX) $(LIBPATH)vmi$(HY_LINKLIB_SUFFIX)
 
 DLLBASE=0x13300000
 COMMENT=/comment:"Accessors native code. (c) Copyright 2006, 2008 The Apache Software Foundation or its licensors, as applicable."

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/META-INF/MANIFEST.MF?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/META-INF/MANIFEST.MF Sat Jul  4 08:38:13 2009
@@ -13,7 +13,6 @@
 Eclipse-JREBundle: true
 Import-Package: java.io,
  java.lang,
- java.lang.ref,
  java.lang.reflect,
  java.net,
  java.nio.charset,
@@ -25,8 +24,7 @@
  org.apache.harmony.luni.platform,
  org.apache.harmony.luni.util,
  org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional,
- tests.support;hy_usage=test;resolution:=optional,
- tests.util;hy_usage=test;resolution:=optional
+ tests.support;hy_usage=test;resolution:=optional
 Export-Package: java.nio,
  java.nio.channels,
  java.nio.channels.spi,

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/build.xml Sat Jul  4 08:38:13 2009
@@ -23,6 +23,8 @@
     <property name="hy.hdk" location="${basedir}/../../deploy" />
     <import file="${hy.hdk}/build/ant/properties.xml" />
 
+    <property name="tests.output" location="../../build/test_report" />
+
     <!-- set global properties for this build. -->
     <xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
 
@@ -198,7 +200,7 @@
     </target>
 
     <target name="run-tests">
-        <mkdir dir="${hy.tests.reports}" />
+        <mkdir dir="${tests.output}" />
 
         <property name="test.jre.home" value="${hy.jdk}/jre" />
 
@@ -225,7 +227,7 @@
 
             <formatter type="xml" />
 
-            <batchtest todir="${hy.tests.reports}" haltonfailure="no">
+            <batchtest todir="${tests.output}" haltonfailure="no">
                 <fileset dir="${hy.nio.src.test.java}">
                     <!-- if ${test.case}     -->
                     <include name="${converted.tc}" if="test.case" />
@@ -249,11 +251,11 @@
     </target>
 
     <target name="touch-failures-file" if="test.failures">
-        <echo file="${hy.tests.reports}/test.failures" append="true">nio${line.separator}</echo>
+        <echo file="${tests.output}/test.failures" append="true">nio${line.separator}</echo>
     </target>
 
     <target name="touch-errors-file" if="test.errors">
-        <echo file="${hy.tests.reports}/test.errors" append="true">nio${line.separator}</echo>
+        <echo file="${tests.output}/test.errors" append="true">nio${line.separator}</echo>
     </target>
 
     <target name="copy-test-resources">

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/make/hyproperties.xml Sat Jul  4 08:38:13 2009
@@ -42,7 +42,4 @@
    <jdk location="../../deploy/jdk" />
    <build location="../../build/classes" />
 
-   <tests>
-      <reports location="../../build/test_report" />
-   </tests>
 </hy>

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/ByteBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/ByteBuffer.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/ByteBuffer.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/ByteBuffer.java Sat Jul  4 08:38:13 2009
@@ -1047,7 +1047,7 @@
      */
     @Override
     public String toString() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append(getClass().getName());
         buf.append(", status: capacity="); //$NON-NLS-1$
         buf.append(capacity());

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/CharBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/CharBuffer.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/CharBuffer.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/CharBuffer.java Sat Jul  4 08:38:13 2009
@@ -686,7 +686,7 @@
      */
     @Override
     public String toString() {
-        StringBuffer strbuf = new StringBuffer();
+        StringBuilder strbuf = new StringBuilder();
         for (int i = position; i < limit; i++) {
             strbuf.append(get(i));
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/DoubleBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/DoubleBuffer.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/DoubleBuffer.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/DoubleBuffer.java Sat Jul  4 08:38:13 2009
@@ -528,7 +528,7 @@
      */
     @Override
     public String toString() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append(getClass().getName());
         buf.append(", status: capacity="); //$NON-NLS-1$
         buf.append(capacity());

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/FloatBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/FloatBuffer.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/FloatBuffer.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/FloatBuffer.java Sat Jul  4 08:38:13 2009
@@ -528,7 +528,7 @@
      */
     @Override
     public String toString() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append(getClass().getName());
         buf.append(", status: capacity="); //$NON-NLS-1$
         buf.append(capacity());

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/IntBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/IntBuffer.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/IntBuffer.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/IntBuffer.java Sat Jul  4 08:38:13 2009
@@ -520,7 +520,7 @@
      */
     @Override
     public String toString() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append(getClass().getName());
         buf.append(", status: capacity="); //$NON-NLS-1$
         buf.append(capacity());

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/LongBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/LongBuffer.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/LongBuffer.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/LongBuffer.java Sat Jul  4 08:38:13 2009
@@ -525,7 +525,7 @@
      */
     @Override
     public String toString() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append(getClass().getName());
         buf.append(", status: capacity="); //$NON-NLS-1$
         buf.append(capacity());

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/ShortBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/ShortBuffer.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/ShortBuffer.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/ShortBuffer.java Sat Jul  4 08:38:13 2009
@@ -524,7 +524,7 @@
      */
     @Override
     public String toString() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append(getClass().getName());
         buf.append(", status: capacity="); //$NON-NLS-1$
         buf.append(capacity());

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/channels/FileLock.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/channels/FileLock.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/channels/FileLock.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/src/main/java/common/java/nio/channels/FileLock.java Sat Jul  4 08:38:13 2009
@@ -195,7 +195,7 @@
     @Override
     @SuppressWarnings("nls")
     public final String toString() {
-        StringBuffer buffer = new StringBuffer(64); // Guess length of string
+        StringBuilder buffer = new StringBuilder(64); // Guess length of string
         buffer.append("FileLock: [position=");
         buffer.append(position);
         buffer.append(", size=");

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/src/main/native/nio/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/src/main/native/nio/unix/makefile?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/src/main/native/nio/unix/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/src/main/native/nio/unix/makefile Sat Jul  4 08:38:13 2009
@@ -31,7 +31,7 @@
 
 MDLLIBFILES = \
 	$(LIBPATH)libhycommon.a \
-	$(LIBPATH)libhypool.a $(LIBPATH)libhyfdlibm.a
+	$(LIBPATH)libhypool.a
 
 DLLNAME = ../libhynio$(HY_SHLIB_SUFFIX)
 EXPNAME = HYNIO_0.1

Modified: harmony/enhanced/classlib/branches/java6/modules/nio/src/main/native/nio/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio/src/main/native/nio/windows/makefile?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio/src/main/native/nio/windows/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio/src/main/native/nio/windows/makefile Sat Jul  4 08:38:13 2009
@@ -37,7 +37,7 @@
 !ENDIF
 
 MDLLIBFILES = $(LIBPATH)hycommon$(HY_LINKLIB_SUFFIX) \
-  $(LIBPATH)hypool$(HY_LINKLIB_SUFFIX) $(LIBPATH)hyfdlibm$(HY_LINKLIB_SUFFIX) \
+  $(LIBPATH)hypool$(HY_LINKLIB_SUFFIX) \
   $(LIBPATH)hythr$(HY_LINKLIB_SUFFIX) $(LIBPATH)vmi$(HY_LINKLIB_SUFFIX)
 
 DLLBASE=0x13200000

Modified: harmony/enhanced/classlib/branches/java6/modules/nio_char/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio_char/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio_char/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio_char/build.xml Sat Jul  4 08:38:13 2009
@@ -25,6 +25,8 @@
     <property name="hy.hdk" location="${basedir}/../../deploy" />
     <import file="${hy.hdk}/build/ant/properties.xml" />
 
+    <property name="tests.output" location="../../build/test_report" />
+
     <!-- set global properties for this build. -->
     <xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
 
@@ -186,7 +188,7 @@
 
     <target name="run-tests">
 
-        <mkdir dir="${hy.tests.reports}" />
+        <mkdir dir="${tests.output}" />
 
         <property name="test.jre.home" value="${hy.jdk}/jre" />
 
@@ -217,7 +219,7 @@
 
             <formatter type="xml" />
 
-            <batchtest todir="${hy.tests.reports}" haltonfailure="no" >
+            <batchtest todir="${tests.output}" haltonfailure="no" >
 
                 <fileset dir="${hy.nio_char.src.test.java}">
                     <!-- if ${test.case}     -->
@@ -233,12 +235,12 @@
     </target>
 
     <target name="touch-failures-file" if="test.failures">
-        <echo file="${hy.tests.reports}/test.failures"
+        <echo file="${tests.output}/test.failures"
             append="true">nio_char${line.separator}</echo>
     </target>
 
     <target name="touch-errors-file" if="test.errors">
-        <echo file="${hy.tests.reports}/test.errors"
+        <echo file="${tests.output}/test.errors"
             append="true">nio_char${line.separator}</echo>
     </target>
 

Modified: harmony/enhanced/classlib/branches/java6/modules/nio_char/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio_char/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio_char/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio_char/make/hyproperties.xml Sat Jul  4 08:38:13 2009
@@ -45,7 +45,4 @@
    <jdk location="../../deploy/jdk" />
    <build location="../../build/classes" />
 
-   <tests>
-      <reports location="../../build/test_report" />
-   </tests>
 </hy>

Modified: harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/native/niochar/windows/hyniochar.def
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/native/niochar/windows/hyniochar.def?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/native/niochar/windows/hyniochar.def (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/native/niochar/windows/hyniochar.def Sat Jul  4 08:38:13 2009
@@ -1,6 +1,6 @@
-LIBRARY	HYCHARSET
-
-SECTIONS
-	.data	READ WRITE
-	.text	EXECUTE READ
-
+LIBRARY	HYNIOCHAR
+
+SECTIONS
+	.data	READ WRITE
+	.text	EXECUTE READ
+

Modified: harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/native/niochar/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/native/niochar/windows/makefile?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/native/niochar/windows/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/nio_char/src/main/native/niochar/windows/makefile Sat Jul  4 08:38:13 2009
@@ -119,6 +119,7 @@
 
 VIRTFILES = hynio_char.res
 
+MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)vmi$(HY_LINKLIB_SUFFIX)
   
 DLLBASE=0x13200000
 COMMENT=/comment:"nio_char component native code. (c) Copyright 1991, 2008 The Apache Software Foundation or its licensors, as applicable."

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/build.xml Sat Jul  4 08:38:13 2009
@@ -21,7 +21,12 @@
 
     <!-- import common properties -->
     <property name="hy.hdk" location="${basedir}/../../deploy" />
+    <property name="hy.jdk" location="${hy.hdk}/jdk" />
+    <property name="depends.dir" location="${basedir}/../../depends" />
     <import file="${hy.hdk}/build/ant/properties.xml" />
+    <import file="${hy.hdk}/build/ant/depends.xml" />
+
+    <property name="tests.output" location="../../build/test_report" />
 
     <!-- set global properties for this build. -->
     <xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
@@ -47,7 +52,25 @@
 
     <property name="pack200.exclude.file" location="${hy.hdk}/build/pack200.exclude" />
 
-    <target name="build" depends="compile-java, copy-resources, build-jar" />
+    <target name="build"
+            depends="check-depends, compile-java, copy-resources, build-jar" />
+
+    <target name="check-depends">
+        <check-one-file src="${asm.url}" dest="${asm.jar}" />
+        <copy todir="${hy.jdk}/jre/lib/boot">
+            <fileset dir="${depends.jars}">
+                <patternset includes="${asm.ver}/*.jar" />
+            </fileset>
+            <fileset dir="depends/manifests"/>
+        </copy>
+
+    </target>
+
+    <target name="fetch-depends">
+        <mkdir dir="${asm.dir}" />
+        <download-one-file src="${asm.url}" dest="${asm.jar}"
+                           md5="${asm.md5}" />
+    </target>
 
     <target name="test" depends="-test-module">
         <fail message="Some tests failed">
@@ -178,7 +201,7 @@
 
     <target name="run-tests">
 
-        <mkdir dir="${hy.tests.reports}" />
+        <mkdir dir="${tests.output}" />
 
         <property name="test.jre.home" value="${hy.jdk}/jre" />
 
@@ -208,7 +231,7 @@
 
             <formatter type="xml" />
 
-            <batchtest todir="${hy.tests.reports}" haltonfailure="no" >
+            <batchtest todir="${tests.output}" haltonfailure="no" >
 
                 <fileset dir="${hy.pack200.src.test.java}">
                     <!-- if ${test.case}     -->
@@ -224,12 +247,12 @@
     </target>
 
     <target name="touch-failures-file" if="test.failures">
-        <echo file="${hy.tests.reports}/test.failures"
+        <echo file="${tests.output}/test.failures"
             append="true">pack200${line.separator}</echo>
     </target>
 
     <target name="touch-errors-file" if="test.errors">
-        <echo file="${hy.tests.reports}/test.errors"
+        <echo file="${tests.output}/test.errors"
             append="true">pack200${line.separator}</echo>
     </target>
 

Propchange: harmony/enhanced/classlib/branches/java6/modules/pack200/depends/manifests/asm-3.1/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Jul  4 08:38:13 2009
@@ -0,0 +1 @@
+/harmony/enhanced/classlib/trunk/modules/pack200/depends/manifests/asm-3.1:785554-790471

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/make/hyproperties.xml Sat Jul  4 08:38:13 2009
@@ -44,7 +44,4 @@
    <jdk location="../../deploy/jdk" />
    <build location="../../build/classes" />
 
-   <tests>
-      <reports location="../../build/test_report" />
-   </tests>
 </hy>

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java Sat Jul  4 08:38:13 2009
@@ -24,6 +24,7 @@
 import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.Iterator;
 import java.util.List;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
@@ -65,6 +66,7 @@
             outputStream = new GZIPOutputStream(outputStream);
         }
         this.outputStream = new BufferedOutputStream(outputStream);
+        PackingUtils.config(options);
     }
 
     /**
@@ -87,6 +89,7 @@
         this.outputStream = new BufferedOutputStream(outputStream);
         this.jarFile = jarFile;
         inputStream = null;
+        PackingUtils.config(options);
     }
 
     /**
@@ -95,30 +98,27 @@
      * @throws IOException
      */
     public void pack() throws Pack200Exception, IOException {
-        List classes = new ArrayList();
-        List files = new ArrayList();
-
         int effort = options.getEffort();
-        long segmentLimit = options.getSegmentLimit();
-
         if(effort == 0) {
             doZeroEffortPack();
         } else {
+            List classes = new ArrayList();
+            List files = new ArrayList();
+            long segmentLimit = options.getSegmentLimit();
+            List segmentUnitList = new ArrayList();
             if (inputStream != null) {
                 Manifest manifest = jarFile != null ? jarFile.getManifest()
                         : inputStream.getManifest();
                 if (manifest != null) {
-                    System.out.println("manifest exists");
-                    System.out.println(manifest.toString());
+                    PackingUtils.log("Pack META-INF/MANIFEST.MF");
                     ByteArrayOutputStream baos = new ByteArrayOutputStream();
                     manifest.write(baos);
-                    files.add(new File("META-INF", new byte[0], 0));
                     files.add(new File("META-INF/MANIFEST.MF", baos.toByteArray(), 0));
                 }
                 JarEntry jarEntry = inputStream.getNextJarEntry();
                 while (jarEntry != null) {
                     if(jarEntry.getName().startsWith("META-INF")) {
-                        System.out.println(jarEntry.getName());
+                        PackingUtils.log("Pack " + jarEntry.getName());
                     }
                     boolean added = addJarEntry(jarEntry,
                             new BufferedInputStream(inputStream), classes,
@@ -126,7 +126,7 @@
                     if (!added) { // not added because segment has reached
                         // maximum size
                         if(classes.size() > 0 || files.size() > 0) {
-                            new Segment().pack(classes, files, outputStream, options);
+                            segmentUnitList.add(new SegmentUnit(classes, files));
                             classes = new ArrayList();
                             files = new ArrayList();
                             currentSegmentSize = 0;
@@ -135,7 +135,7 @@
                         }
                     } else if (segmentLimit == 0 && estimateSize(jarEntry) > 0) {
                         // create a new segment for each class unless size = 0
-                        new Segment().pack(classes, files, outputStream, options);
+                        segmentUnitList.add(new SegmentUnit(classes, files));
                         classes = new ArrayList();
                         files = new ArrayList();
                     }
@@ -149,7 +149,7 @@
                             jarFile.getInputStream(jarEntry)), classes, files);
                     if (!added) { // not added because segment has reached maximum
                         // size
-                        new Segment().pack(classes, files, outputStream, options);
+                        segmentUnitList.add(new SegmentUnit(classes, files));
                         classes = new ArrayList();
                         files = new ArrayList();
                         currentSegmentSize = 0;
@@ -158,41 +158,58 @@
                         currentSegmentSize = 0; // ignore the size of the first entry for compatibility with the RI
                     } else if (segmentLimit == 0 && estimateSize(jarEntry) > 0) {
                         // create a new segment for each class unless size = 0
-                        new Segment().pack(classes, files, outputStream, options);
+                        segmentUnitList.add(new SegmentUnit(classes, files));
                         classes = new ArrayList();
                         files = new ArrayList();
                     }
                 }
             }
             if(classes.size() > 0 || files.size() > 0) {
-                new Segment().pack(classes, files, outputStream, options);
+                segmentUnitList.add(new SegmentUnit(classes, files));
+            }
+
+            int size = segmentUnitList.size();
+            int classFileAmount = 0;
+            int fileAmount = 0;
+            int totalByteAmount = 0;
+            int totalPackedByteAmount = 0;
+            SegmentUnit segmentUnit = null;
+            for (int index = 0; index < size; index++) {
+                segmentUnit = (SegmentUnit) segmentUnitList.get(index);
+                classFileAmount += segmentUnit.classList.size();
+                fileAmount += segmentUnit.fileList.size();
+                new Segment().pack(segmentUnit, outputStream, options);
+                totalByteAmount += segmentUnit.getByteAmount();
+                totalPackedByteAmount += segmentUnit.getPackedByteAmount();
             }
+            PackingUtils.log("Total: Packed " + fileAmount + " files including "
+                    + classFileAmount + " classes of " + totalByteAmount
+                    + " input bytes into " + totalPackedByteAmount + " bytes");
+
             outputStream.close();
         }
     }
 
     private void doZeroEffortPack() throws IOException, Pack200Exception {
+        PackingUtils.log("Start to perform a zero-effort packing");
         JarOutputStream jarOutputStream = new JarOutputStream(outputStream);
         if(inputStream != null) {
-            JarInputStream jarInputStream;
-            if(!(inputStream instanceof JarInputStream)) {
-                jarInputStream = new JarInputStream(inputStream);
-            } else {
-                jarInputStream = inputStream;
-            }
-            Manifest manifest = jarInputStream.getManifest();
+            Manifest manifest = inputStream.getManifest();
             if (manifest != null) {
                 jarOutputStream.putNextEntry(new JarEntry("META-INF/"));
                 jarOutputStream.closeEntry();
+                PackingUtils.log("Packed \"META-INF\" folder");
+                
                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
                 manifest.write(baos);
                 jarOutputStream.putNextEntry(new JarEntry("META-INF/MANIFEST.MF"));
                 jarOutputStream.write(baos.toByteArray());
                 jarOutputStream.closeEntry();
+                PackingUtils.log("Packed META-INF/MANIFEST.MF");
             }
-            BufferedInputStream buff = new BufferedInputStream(jarInputStream);
+            BufferedInputStream buff = new BufferedInputStream(inputStream);
             JarEntry jarEntry;
-            while ((jarEntry = jarInputStream.getNextJarEntry()) != null) {
+            while ((jarEntry = inputStream.getNextJarEntry()) != null) {
                 jarOutputStream.putNextEntry(jarEntry);
                 byte[] bytes = new byte[(int) jarEntry.getSize()];
                 int bytesRead = buff.read(bytes);
@@ -201,6 +218,7 @@
                 }
                 jarOutputStream.write(bytes, 0, bytesRead);
                 jarOutputStream.closeEntry();
+                PackingUtils.log("Packed " + jarEntry.getName());
             }
             jarOutputStream.close();
         } else {
@@ -217,6 +235,7 @@
                     bytesRead = inStream.read(bytes);
                 }
                 jarOutputStream.closeEntry();
+                PackingUtils.log("Packed " + jarEntry.getName());
             }
             jarOutputStream.close();
         }
@@ -249,7 +268,7 @@
         if (read != size) {
             throw new RuntimeException("Error reading from stream");
         }
-        if (name.endsWith(".class")) {
+        if (name.endsWith(".class") && !options.isPassFile(name)) {
             Pack200ClassReader classParser = new Pack200ClassReader(bytes);
             classParser.setFileName(name);
             javaClasses.add(classParser);
@@ -273,6 +292,63 @@
         }
     }
 
+    static class SegmentUnit {
+
+        private List classList;
+
+        private List fileList;
+
+        private int byteAmount = 0;
+
+        private int packedByteAmount = 0;
+
+        public SegmentUnit(List classes, List files) {
+            classList = classes;
+            fileList = files;
+
+            // Calculate the amount of bytes in classes and files before packing
+            Pack200ClassReader classReader;
+            for (Iterator iterator = classList.iterator(); iterator.hasNext();) {
+                classReader = (Pack200ClassReader) iterator.next();
+                byteAmount += classReader.b.length;
+            }
+
+            File file;
+            for (Iterator iterator = fileList.iterator(); iterator.hasNext();) {
+                file = (File) iterator.next();
+                byteAmount += file.contents.length;
+            }
+        }
+
+        public List getClassList() {
+            return classList;
+        }
+
+        public int classListSize() {
+            return classList.size();
+        }
+
+        public int fileListSize() {
+            return fileList.size();
+        }
+
+        public List getFileList() {
+            return fileList;
+        }
+
+        public int getByteAmount() {
+            return byteAmount;
+        }
+
+        public int getPackedByteAmount() {
+            return packedByteAmount;
+        }
+
+        public void addPackedByteAmount(int amount) {
+            packedByteAmount += amount;
+        }
+    }
+
     static class File {
 
         private final String name;

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeDefinitionBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeDefinitionBands.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeDefinitionBands.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeDefinitionBands.java Sat Jul  4 08:38:13 2009
@@ -122,6 +122,7 @@
     }
 
     public void pack(OutputStream out) throws IOException, Pack200Exception {
+        PackingUtils.log("Writing attribute definition bands...");
         int[] attributeDefinitionHeader = new int[attributeDefinitions.size()];
         int[] attributeDefinitionName = new int[attributeDefinitions.size()];
         int[] attributeDefinitionLayout = new int[attributeDefinitions.size()];
@@ -134,12 +135,26 @@
             attributeDefinitionLayout[i] = def.layout.getIndex();
         }
 
-        out.write(encodeBandInt("attributeDefinitionHeader",
-                attributeDefinitionHeader, Codec.BYTE1));
-        out.write(encodeBandInt("attributeDefinitionName",
-                attributeDefinitionName, Codec.UNSIGNED5));
-        out.write(encodeBandInt("attributeDefinitionLayout",
-                attributeDefinitionLayout, Codec.UNSIGNED5));
+        byte[] encodedBand = encodeBandInt("attributeDefinitionHeader",
+                attributeDefinitionHeader, Codec.BYTE1);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from attributeDefinitionHeader["
+                + attributeDefinitionHeader.length + "]");
+
+        encodedBand = encodeBandInt("attributeDefinitionName",
+                attributeDefinitionName, Codec.UNSIGNED5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from attributeDefinitionName["
+                + attributeDefinitionName.length + "]");
+
+        encodedBand = encodeBandInt("attributeDefinitionLayout",
+                attributeDefinitionLayout, Codec.UNSIGNED5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from attributeDefinitionLayout["
+                + attributeDefinitionLayout.length + "]");
     }
 
     private void addSyntheticDefinitions() {

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java Sat Jul  4 08:38:13 2009
@@ -97,7 +97,7 @@
     private final int h;
 
     /**
-     * The co-parameter of h; h-256
+     * The co-parameter of h; 256-h
      */
     private final int l;
 
@@ -127,7 +127,7 @@
      *            the radix of the encoding [1..256]
      */
     public BHSDCodec(int b, int h) {
-        this(b, h, 0);
+        this(b, h, 0, 0);
     }
 
     /**
@@ -162,18 +162,24 @@
      *            delta)
      */
     public BHSDCodec(int b, int h, int s, int d) {
-        if (b < 1 || b > 5)
+        if (b < 1 || b > 5) {
             throw new IllegalArgumentException("1<=b<=5");
-        if (h < 1 || h > 256)
+        }
+        if (h < 1 || h > 256) {
             throw new IllegalArgumentException("1<=h<=256");
-        if (s < 0 || s > 2)
+        }
+        if (s < 0 || s > 2) {
             throw new IllegalArgumentException("0<=s<=2");
-        if (d < 0 || d > 1)
+        }
+        if (d < 0 || d > 1) {
             throw new IllegalArgumentException("0<=d<=1");
-        if (b == 1 && h != 256)
+        }
+        if (b == 1 && h != 256) {
             throw new IllegalArgumentException("b=1 -> h=256");
-        if (h == 256 && b == 5)
+        }
+        if (h == 256 && b == 5) {
             throw new IllegalArgumentException("h=256 -> b!=5");
+        }
         this.b = b;
         this.h = h;
         this.s = s;
@@ -205,9 +211,10 @@
     }
 
     public int decode(InputStream in) throws IOException, Pack200Exception {
-        if (d != 0)
+        if (d != 0) {
             throw new Pack200Exception(
                     "Delta encoding used without passing in last value; this is a coding error");
+        }
         return decode(in, 0);
     }
 
@@ -224,9 +231,10 @@
             n++;
         } while (x >= l && n < b);
 
-        if (x == -1)
+        if (x == -1) {
             throw new EOFException("End of stream reached whilst decoding");
-
+        }
+        
         if (isSigned()) {
             int u = ((1 << s) - 1);
             if ((z & u) == u) {
@@ -251,8 +259,9 @@
         // z = (long) (-Math.floor(u/ twoPowS) - 1);
         // }
         // }
-        if (isDelta())
+        if (isDelta()) {
             z += last;
+        }
         return (int)z;
     }
 
@@ -333,7 +342,7 @@
         } else {
             if (z < 0) {
                 // Need to use integer overflow here to represent negatives.
-                if(cardinality < 4294967296L) {
+                if (cardinality < 4294967296L) {
                     z += cardinality;
                 } else {
                     z += 4294967296L; // this value is equal to (1 << 32).
@@ -351,8 +360,9 @@
                 byteN = z;
             } else {
                 byteN = z % h;
-                while (byteN < l)
+                while (byteN < l) {
                     byteN += h;
+                }
             }
             byteList.add(new Byte((byte) byteN));
             if (byteN < l) {
@@ -493,11 +503,11 @@
     }
 
     public boolean equals(Object o) {
-        if(!(o instanceof BHSDCodec)) {
-            return false;
+        if (o instanceof BHSDCodec) {
+            BHSDCodec codec = (BHSDCodec) o;
+            return codec.b == b && codec.h == h && codec.s == s && codec.d == d;
         }
-        BHSDCodec codec = (BHSDCodec) o;
-        return codec.b == b && codec.h == h && codec.s == s && codec.d == d;
+        return false;
     }
 
     public int hashCode() {

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BandSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BandSet.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BandSet.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BandSet.java Sat Jul  4 08:38:13 2009
@@ -36,7 +36,7 @@
 
     // Minimum size of band for each effort level where we consider alternative codecs
     // Note: these values have been tuned - please test carefully if changing them
-    private final int[] effortThresholds = new int[] {0, 0, 1000, 500, 100, 100, 100, 100, 100, 0};
+    private static final int[] effortThresholds = new int[] {0, 0, 1000, 500, 100, 100, 100, 100, 100, 0};
 
     private long[] canonicalLargest;
     private long[] canonicalSmallest;
@@ -419,7 +419,7 @@
             }
         }
         favoured.add(favoured.get(favoured.size() - 1)); // repeat last value
-        int[] favouredBand = listToArray(favoured);
+        int[] favouredBand = integerListToArray(favoured);
         int[] unfavouredBand = unfavoured.toArray();
 
         // Analyse the three bands to get the best codec
@@ -592,7 +592,7 @@
     /**
      * Converts a list of Integers to an int[] array
      */
-    protected int[] listToArray(List integerList) {
+    protected int[] integerListToArray(List integerList) {
         int[] array = new int[integerList.size()];
         for (int i = 0; i < array.length; i++) {
             array[i] = ((Integer)integerList.get(i)).intValue();
@@ -646,6 +646,9 @@
         return encodeFlags(name, flatten(flags), loCodec, hiCodec, haveHiFlags);
    }
 
+    /*
+     * Flatten a 2-dimension array into a 1-dimension array
+     */
     private long[] flatten(long[][] flags) {
         int totalSize = 0;
         for (int i = 0; i < flags.length; i++) {

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java Sat Jul  4 08:38:13 2009
@@ -99,51 +99,138 @@
     }
 
     public void pack(OutputStream out) throws IOException, Pack200Exception {
-        out.write(encodeBandInt("bcCodes", bcCodes.toArray(), Codec.BYTE1));
-        out.write(encodeBandInt("bcCaseCount", bcCaseCount.toArray(),
-                Codec.UNSIGNED5));
-        out.write(encodeBandInt("bcCaseValue", bcCaseValue.toArray(),
-                Codec.DELTA5));
-        out.write(encodeBandInt("bcByte", bcByte.toArray(), Codec.BYTE1));
-        out.write(encodeBandInt("bcShort", bcShort.toArray(), Codec.DELTA5));
-        out.write(encodeBandInt("bcLocal", bcLocal.toArray(),
-                Codec.UNSIGNED5));
-        out
-                .write(encodeBandInt("bcLabel", listToArray(bcLabel),
-                        Codec.BRANCH5));
-        out.write(encodeBandInt("bcIntref", cpEntryListToArray(bcIntref),
-                Codec.DELTA5));
-        out.write(encodeBandInt("bcFloatRef", cpEntryListToArray(bcFloatRef),
-                Codec.DELTA5));
-        out.write(encodeBandInt("bcLongRef", cpEntryListToArray(bcLongRef),
-                Codec.DELTA5));
-        out.write(encodeBandInt("bcDoubleRef", cpEntryListToArray(bcDoubleRef),
-                Codec.DELTA5));
-        out.write(encodeBandInt("bcStringRef", cpEntryListToArray(bcStringRef),
-                Codec.DELTA5));
-        out.write(encodeBandInt("bcClassRef",
-                cpEntryOrNullListToArray(bcClassRef), Codec.UNSIGNED5));
-        out.write(encodeBandInt("bcFieldRef", cpEntryListToArray(bcFieldRef),
-                Codec.DELTA5));
-        out.write(encodeBandInt("bcMethodRef", cpEntryListToArray(bcMethodRef),
-                Codec.UNSIGNED5));
-        out.write(encodeBandInt("bcIMethodRef",
-                cpEntryListToArray(bcIMethodRef), Codec.DELTA5));
-        out.write(encodeBandInt("bcThisField", listToArray(bcThisField),
-                Codec.UNSIGNED5));
-        out.write(encodeBandInt("bcSuperField", listToArray(bcSuperField),
-                Codec.UNSIGNED5));
-        out.write(encodeBandInt("bcThisMethod", listToArray(bcThisMethod),
-                Codec.UNSIGNED5));
-        out.write(encodeBandInt("bcSuperMethod",
-                listToArray(bcSuperMethod), Codec.UNSIGNED5));
-        out.write(encodeBandInt("bcInitRef", listToArray(bcInitRef),
-                Codec.UNSIGNED5));
-        // out.write(encodeBandInt(cpEntryListToArray(bcEscRef),
+        PackingUtils.log("Writing byte code bands...");
+        byte[] encodedBand = encodeBandInt("bcCodes", bcCodes.toArray(),
+                Codec.BYTE1);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length + " bytes from bcCodes["
+                + bcCodes.size() + "]");
+
+        encodedBand = encodeBandInt("bcCaseCount", bcCaseCount.toArray(),
+                Codec.UNSIGNED5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcCaseCount[" + bcCaseCount.size() + "]");
+
+        encodedBand = encodeBandInt("bcCaseValue", bcCaseValue.toArray(),
+                Codec.DELTA5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcCaseValue[" + bcCaseValue.size() + "]");
+
+        encodedBand = encodeBandInt("bcByte", bcByte.toArray(), Codec.BYTE1);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length + " bytes from bcByte["
+                + bcByte.size() + "]");
+
+        encodedBand = encodeBandInt("bcShort", bcShort.toArray(), Codec.DELTA5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length + " bytes from bcShort["
+                + bcShort.size() + "]");
+
+        encodedBand = encodeBandInt("bcLocal", bcLocal.toArray(),
+                Codec.UNSIGNED5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length + " bytes from bcLocal["
+                + bcLocal.size() + "]");
+
+        encodedBand = encodeBandInt("bcLabel", integerListToArray(bcLabel),
+                Codec.BRANCH5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length + " bytes from bcLabel["
+                + bcLabel.size() + "]");
+
+        encodedBand = encodeBandInt("bcIntref", cpEntryListToArray(bcIntref),
+                Codec.DELTA5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcIntref[" + bcIntref.size() + "]");
+
+        encodedBand = encodeBandInt("bcFloatRef",
+                cpEntryListToArray(bcFloatRef), Codec.DELTA5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcFloatRef[" + bcFloatRef.size() + "]");
+
+        encodedBand = encodeBandInt("bcLongRef", cpEntryListToArray(bcLongRef),
+                Codec.DELTA5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcLongRef[" + bcLongRef.size() + "]");
+
+        encodedBand = encodeBandInt("bcDoubleRef",
+                cpEntryListToArray(bcDoubleRef), Codec.DELTA5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcDoubleRef[" + bcDoubleRef.size() + "]");
+
+        encodedBand = encodeBandInt("bcStringRef",
+                cpEntryListToArray(bcStringRef), Codec.DELTA5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcStringRef[" + bcStringRef.size() + "]");
+
+        encodedBand = encodeBandInt("bcClassRef",
+                cpEntryOrNullListToArray(bcClassRef), Codec.UNSIGNED5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcClassRef[" + bcClassRef.size() + "]");
+
+        encodedBand = encodeBandInt("bcFieldRef",
+                cpEntryListToArray(bcFieldRef), Codec.DELTA5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcFieldRef[" + bcFieldRef.size() + "]");
+
+        encodedBand = encodeBandInt("bcMethodRef",
+                cpEntryListToArray(bcMethodRef), Codec.UNSIGNED5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcMethodRef[" + bcMethodRef.size() + "]");
+
+        encodedBand = encodeBandInt("bcIMethodRef",
+                cpEntryListToArray(bcIMethodRef), Codec.DELTA5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcIMethodRef[" + bcIMethodRef.size() + "]");
+
+        encodedBand = encodeBandInt("bcThisField",
+                integerListToArray(bcThisField), Codec.UNSIGNED5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcThisField[" + bcThisField.size() + "]");
+
+        encodedBand = encodeBandInt("bcSuperField",
+                integerListToArray(bcSuperField), Codec.UNSIGNED5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcSuperField[" + bcSuperField.size() + "]");
+
+        encodedBand = encodeBandInt("bcThisMethod",
+                integerListToArray(bcThisMethod), Codec.UNSIGNED5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcThisMethod[" + bcThisMethod.size() + "]");
+
+        encodedBand = encodeBandInt("bcSuperMethod",
+                integerListToArray(bcSuperMethod), Codec.UNSIGNED5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcSuperMethod[" + bcSuperMethod.size() + "]");
+
+        encodedBand = encodeBandInt("bcInitRef", integerListToArray(bcInitRef),
+                Codec.UNSIGNED5);
+        out.write(encodedBand);
+        PackingUtils.log("Wrote " + encodedBand.length
+                + " bytes from bcInitRef[" + bcInitRef.size() + "]");
+
+        // out.write(encodeBandInt(cpEntryintegerListToArray(bcEscRef),
+        // Codec.UNSIGNED5));
+        // out.write(encodeBandInt(integerListToArray(bcEscRefSize),
+        // Codec.UNSIGNED5));
+        // out.write(encodeBandInt(integerListToArray(bcEscSize),
         // Codec.UNSIGNED5));
-        // out.write(encodeBandInt(listToArray(bcEscRefSize), Codec.UNSIGNED5));
-        // out.write(encodeBandInt(listToArray(bcEscSize), Codec.UNSIGNED5));
-        // out.write(encodeBandInt(listToArray(bcEscByte), Codec.BYTE1));
+        // out.write(encodeBandInt(integerListToArray(bcEscByte), Codec.BYTE1));
     }
 
     private List getIndexInClass(List cPMethodOrFieldList) {



Mime
View raw message