Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 27315 invoked from network); 2 Sep 2008 10:56:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Sep 2008 10:56:57 -0000 Received: (qmail 75131 invoked by uid 500); 2 Sep 2008 10:56:54 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 75097 invoked by uid 500); 2 Sep 2008 10:56:53 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 75086 invoked by uid 99); 2 Sep 2008 10:56:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 03:56:53 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sianjanuary@googlemail.com designates 209.85.198.249 as permitted sender) Received: from [209.85.198.249] (HELO rv-out-0708.google.com) (209.85.198.249) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 10:55:52 +0000 Received: by rv-out-0708.google.com with SMTP id k29so1906853rvb.0 for ; Tue, 02 Sep 2008 03:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=uevfS4RMU/6jWzzSJxLGXyALMKMikxF5wY4L461vZsk=; b=GggzVAKkjtvtX0O53kX9cksXYFfOOAKw9AUV3rBrx5r3HB/h4Vg7E0QRkNcMfmPe45 9yjuvafyLtZ8c/YP7IGhPkVOpSM2oPVTsylpEIcfgECf4HGMt2uCT3t1VdWswi6Gg63e kAut0u8HpzatnjOgS8exSxnqJX3wQO1rIsrH0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Vh9VmTjVjKmSbs8aLsM3HQw8mSonRA9ngFFvHtYychUS9AKrhbvenWoBzrGO9UIcgl R81fbO2YiiaB96/6VgjDp4RhdTgSHFyLqAiB2VIDTe9iE+5iyiOhbmdfZVBMUmGNNZH2 115sYftPR+EHqpbZnPEkJYHzGMsIHxwYO2sc4= Received: by 10.114.176.1 with SMTP id y1mr6094828wae.118.1220352973879; Tue, 02 Sep 2008 03:56:13 -0700 (PDT) Received: by 10.114.200.1 with HTTP; Tue, 2 Sep 2008 03:56:13 -0700 (PDT) Message-ID: Date: Tue, 2 Sep 2008 11:56:13 +0100 From: "Sian January" To: dev@harmony.apache.org Subject: Re: svn commit: r690951 - in /harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200: BcBands.java ClassBands.java In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080901120810.2F972238889D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Thanks Chunrong - I've just fixed it. On 02/09/2008, chunrong lai wrote: > As reported in the integrity testing, the commit breaks quite a few of the > org.apache.harmony.unpack200.tests.BcBandsTest in classlib. > > http://people.apache.org/~chunrong/harmony-integrity/linux_x86/classlib-test/ > > error testSimple org.apache.harmony.unpack200.tests.BcBandsTest error > testMultipleClassesSimple org.apache.harmony.unpack200.tests.BcBandsTest error > testMultipleMethodsSimple org.apache.harmony.unpack200.tests.BcBandsTest error > testBcCaseBands org.apache.harmony.unpack200.tests.BcBandsTest error > testBcByteBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcShortBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcLocalBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcLabelBand org.apache.harmony.unpack200.tests.BcBandsTest error > testWideForms org.apache.harmony.unpack200.tests.BcBandsTest error > testBcIntRefBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcFloatRefBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcLongRefBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcDoubleRefBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcStringRefBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcClassRefBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcFieldRefBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcMethodRefBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcIMethodRefBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcThisFieldBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcSuperFieldBand org.apache.harmony.unpack200.tests.BcBandsTest error > testBcThisMethodBand org.apache.harmony.unpack200.tests.BcBandsTest > > Test: testSimple Class: > org.apache.harmony.unpack200.tests.BcBandsTest > java.lang.NullPointerException > at org.apache.harmony.unpack200.BcBands.unpack(BcBands.java:471) at > org.apache.harmony.unpack200.BandSet.unpack(BandSet.java:53) at > org.apache.harmony.unpack200.tests.BcBandsTest.testSimple(BcBandsTest.java:251) > at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)....... > > > On 9/1/08, sjanuary@apache.org wrote: > > > > Author: sjanuary > > Date: Mon Sep 1 05:08:09 2008 > > New Revision: 690951 > > > > URL: http://svn.apache.org/viewvc?rev=690951&view=rev > > Log: > > Tentative 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 > > > > harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.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=690951&r1=690950&r2=690951&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 > > Mon Sep 1 05:08:09 2008 > > @@ -20,6 +20,7 @@ > > import java.io.IOException; > > import java.io.InputStream; > > import java.util.ArrayList; > > +import java.util.Collections; > > import java.util.List; > > > > import org.apache.harmony.pack200.Codec; > > @@ -396,6 +397,7 @@ > > int i = 0; > > ArrayList orderedCodeAttributes = segment.getClassBands() > > .getOrderedCodeAttributes(); > > + int codeAttributeIndex = 0; > > > > // Exception table fields > > int[] handlerCount = segment.getClassBands().getCodeHandlerCount(); > > @@ -407,6 +409,9 @@ > > int[][] handlerClassTypes = segment.getClassBands() > > .getCodeHandlerClassRCN(); > > > > + boolean allCodeHasFlags = > > segment.getSegmentHeader().getOptions().hasAllCodeFlags(); > > + boolean[] codeHasFlags = > > segment.getClassBands().getCodeHasAttributes(); > > + > > for (int c = 0; c < classCount; c++) { > > int numberOfMethods = methodFlags[c].length; > > for (int m = 0; m < numberOfMethods; m++) { > > @@ -459,18 +464,26 @@ > > } > > methodAttributesList.add(indexForCodeAttr, codeAttr); > > codeAttr.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); > > - } > > + List currentAttributes; > > + if (allCodeHasFlags) { > > + currentAttributes = (List) > > orderedCodeAttributes.get(i); > > + } else { > > + if (codeHasFlags[i]) { > > + currentAttributes = (List) > > orderedCodeAttributes > > + .get(codeAttributeIndex); > > + codeAttributeIndex++; > > + } else { > > + currentAttributes = Collections.EMPTY_LIST; > > + } > > + } > > + 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++; > > > > Modified: > > harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java > > URL: > > http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java?rev=690951&r1=690950&r2=690951&view=diff > > > > ============================================================================== > > --- > > harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java > > (original) > > +++ > > harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java > > Mon Sep 1 05:08:09 2008 > > @@ -68,7 +68,7 @@ > > > > private IcTuple[][] icLocal; > > > > - private ArrayList[] codeAttributes; > > + private List[] codeAttributes; > > > > private int[] codeHandlerCount; > > > > @@ -114,6 +114,8 @@ > > > > private int[][] codeHandlerClassRCN; > > > > + private boolean [] codeHasAttributes; > > + > > /** > > * @param segment > > */ > > @@ -718,10 +720,19 @@ > > int codeCount = SegmentUtils.countMatches(methodFlags, layout); > > int[] codeHeaders = decodeBandInt("code_headers", in, Codec.BYTE1, > > codeCount); > > + > > + boolean allCodeHasFlags = > > segment.getSegmentHeader().getOptions().hasAllCodeFlags(); > > + if(!allCodeHasFlags) { > > + codeHasAttributes = new boolean[codeCount]; > > + } > > int codeSpecialHeader = 0; > > for (int i = 0; i < codeCount; i++) { > > - if (codeHeaders[i] == 0) > > + if (codeHeaders[i] == 0) { > > codeSpecialHeader++; > > + if(!allCodeHasFlags) { > > + codeHasAttributes[i] = true; > > + } > > + } > > } > > int[] codeMaxStackSpecials = decodeBandInt("code_max_stack", in, > > Codec.UNSIGNED5, codeSpecialHeader); > > @@ -768,10 +779,9 @@ > > codeHandlerClassRCN = decodeBandInt( > > "code_handler_class_RCN", in, Codec.UNSIGNED5, > > codeHandlerCount); > > > > - int codeFlagsCount = segment.getSegmentHeader().getOptions() > > - .hasAllCodeFlags() ? codeCount : codeSpecialHeader; > > + int codeFlagsCount = allCodeHasFlags ? codeCount : > > codeSpecialHeader; > > > > - codeAttributes = new ArrayList[codeFlagsCount]; > > + codeAttributes = new List[codeFlagsCount]; > > for (int i = 0; i < codeAttributes.length; i++) { > > codeAttributes[i] = new ArrayList(); > > } > > @@ -1389,4 +1399,8 @@ > > return icLocal; > > } > > > > + public boolean[] getCodeHasAttributes() { > > + return codeHasAttributes; > > + } > > + > > } > > > > > > > -- Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU