harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r689764 - /harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java
Date Thu, 28 Aug 2008 09:21:31 GMT
Author: sjanuary
Date: Thu Aug 28 02:21:31 2008
New Revision: 689764

URL: http://svn.apache.org/viewvc?rev=689764&view=rev
Log:
Fix for HARMONY-5960 ([pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
)

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

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java?rev=689764&r1=689763&r2=689764&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java
Thu Aug 28 02:21:31 2008
@@ -459,16 +459,18 @@
                     }
                     methodAttributesList.add(indexForCodeAttr, codeAttr);
                     codeAttr.renumber(codeAttr.byteCodeOffsets);
-                    ArrayList currentAttributes = (ArrayList) orderedCodeAttributes
-                            .get(i);
-                    for (int index = 0; index < currentAttributes.size(); index++) {
-                        Attribute currentAttribute = (Attribute) currentAttributes
-                                .get(index);
-                        codeAttr.addAttribute(currentAttribute);
-                        // Fix up the line numbers if needed
-                        if (currentAttribute.hasBCIRenumbering()) {
-                            ((BCIRenumberedAttribute) currentAttribute)
-                                    .renumber(codeAttr.byteCodeOffsets);
+                    if(orderedCodeAttributes.size() > 0) {
+                        ArrayList currentAttributes = (ArrayList) orderedCodeAttributes
+                                .get(i);
+                        for (int index = 0; index < currentAttributes.size(); index++)
{
+                            Attribute currentAttribute = (Attribute) currentAttributes
+                                    .get(index);
+                            codeAttr.addAttribute(currentAttribute);
+                            // Fix up the line numbers if needed
+                            if (currentAttribute.hasBCIRenumbering()) {
+                                ((BCIRenumberedAttribute) currentAttribute)
+                                        .renumber(codeAttr.byteCodeOffsets);
+                            }
                         }
                     }
                     i++;



Mime
View raw message