harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r637969 - /harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java
Date Mon, 17 Mar 2008 16:49:42 GMT
Author: sjanuary
Date: Mon Mar 17 09:49:41 2008
New Revision: 637969

URL: http://svn.apache.org/viewvc?rev=637969&view=rev
Log:
Fix for HARMONY-5611 ([classlib][pack200] IcTuple parsing broken: IcTuple.C can equal IcTuple.C2?)

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

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java?rev=637969&r1=637968&r2=637969&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java
Mon Mar 17 09:49:41 2008
@@ -55,10 +55,25 @@
                 innerClassCount, cpClass);
         int[] icFlags = decodeBandInt("ic_flags", in, Codec.UNSIGNED5, innerClassCount);
         int outerClasses = SegmentUtils.countBit16(icFlags);
-        String[] icOuterClass = parseReferences("ic_outer_class", in, Codec.DELTA5,
-                outerClasses, cpClass);
-        String[] icName = parseReferences("ic_name", in, Codec.DELTA5, outerClasses,
-                cpUTF8);
+        int[] icOuterClassInts = decodeBandInt("ic_outer_class", in, Codec.DELTA5,
+                outerClasses);
+        String[] icOuterClass = new String[outerClasses];
+        for (int i = 0; i < icOuterClass.length; i++) {
+        	if(icOuterClassInts[i] == 0) {
+        		icOuterClass[i] = null;
+        	} else {
+        		icOuterClass[i] = cpClass[icOuterClassInts[i] - 1];
+        	}
+		}
+        int[] icNameInts = decodeBandInt("ic_name", in, Codec.DELTA5, outerClasses);
+        String[] icName = new String[outerClasses];
+        for (int i = 0; i < icName.length; i++) {
+        	if(icNameInts[i] == 0) {
+        		icName[i] = null;
+        	} else {
+        		icName[i] = cpUTF8[icNameInts[i] - 1];
+        	}
+		}
 
         // Construct IC tuples
         icAll = new IcTuple[icThisClass.length];



Mime
View raw message