harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r721518 - /harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
Date Fri, 28 Nov 2008 15:27:59 GMT
Author: sjanuary
Date: Fri Nov 28 07:27:59 2008
New Revision: 721518

URL: http://svn.apache.org/viewvc?rev=721518&view=rev
Log:
Pack200 - fix bug in cp_utf8 band encoding

Modified:
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java?rev=721518&r1=721517&r2=721518&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
Fri Nov 28 07:27:59 2008
@@ -139,24 +139,27 @@
         }
         int[] cpUtf8Chars = new int[chars.size()];
         int[] cpUtf8BigSuffix = new int[bigSuffix.size()];
-        int[] cpUtf8BigChars = new int[bigChars.size()];
+        int[][] cpUtf8BigChars = new int[bigSuffix.size()][];
         for (int i = 0; i < cpUtf8Chars.length; i++) {
             cpUtf8Chars[i] = ((Character) chars.get(i)).charValue();
         }
         for (int i = 0; i < cpUtf8BigSuffix.length; i++) {
-            cpUtf8BigSuffix[i] = ((Integer) bigSuffix.get(i)).intValue();
-        }
-        for (int i = 0; i < cpUtf8BigChars.length; i++) {
-            cpUtf8BigChars[i] = ((Character) bigChars.get(i)).charValue();
+            int numBigChars = ((Integer) bigSuffix.get(i)).intValue();
+            cpUtf8BigSuffix[i] = numBigChars;
+            cpUtf8BigChars[i] = new int[numBigChars];
+            for (int j = 0; j < numBigChars; j++) {
+                cpUtf8BigChars[i][j] = ((Character) bigChars.remove(0)).charValue();
+            }
         }
         out.write(encodeBandInt("cpUtf8Prefix", cpUtf8Prefix, Codec.DELTA5));
         out.write(encodeBandInt("cpUtf8Suffix", cpUtf8Suffix, Codec.UNSIGNED5));
         out.write(encodeBandInt("cpUtf8Chars", cpUtf8Chars, Codec.CHAR3));
         out.write(encodeBandInt("cpUtf8BigSuffix", cpUtf8BigSuffix,
                 Codec.DELTA5));
-        out
-                .write(encodeBandInt("cpUtf8BigChars", cpUtf8BigChars,
+        for (int i = 0; i < cpUtf8BigChars.length; i++) {
+            out.write(encodeBandInt("cpUtf8BigChars " + i, cpUtf8BigChars[i],
                         Codec.DELTA5));
+        }
     }
 
     private void addCharacters(List chars, char[] charArray) {



Mime
View raw message