Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 251C4119A4 for ; Mon, 28 Jul 2014 20:34:14 +0000 (UTC) Received: (qmail 57089 invoked by uid 500); 28 Jul 2014 20:34:14 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 57025 invoked by uid 500); 28 Jul 2014 20:34:13 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 57016 invoked by uid 99); 28 Jul 2014 20:34:13 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jul 2014 20:34:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jul 2014 20:34:00 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5DE9823889EB; Mon, 28 Jul 2014 20:33:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1614159 - in /commons/proper/bcel/trunk/src: changes/changes.xml main/java/org/apache/bcel/classfile/MethodParameters.java Date: Mon, 28 Jul 2014 20:33:35 -0000 To: commits@commons.apache.org From: markt@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140728203335.5DE9823889EB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: markt Date: Mon Jul 28 20:33:34 2014 New Revision: 1614159 URL: http://svn.apache.org/r1614159 Log: Fix BCEL-177 MethodParameter parameter count is one byte, not two. Modified: commons/proper/bcel/trunk/src/changes/changes.xml commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/MethodParameters.java Modified: commons/proper/bcel/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/changes/changes.xml?rev=1614159&r1=1614158&r2=1614159&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/changes/changes.xml (original) +++ commons/proper/bcel/trunk/src/changes/changes.xml Mon Jul 28 20:33:34 2014 @@ -246,6 +246,10 @@ The type attribute can be add,u Verification of interfaces with default methods fails with Java 8 + + When reading the number of parameters in a MethodParameters structure + only read a single byte as per the JVM specification. + Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/MethodParameters.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/MethodParameters.java?rev=1614159&r1=1614158&r2=1614159&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/MethodParameters.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/MethodParameters.java Mon Jul 28 20:33:34 2014 @@ -12,7 +12,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the License. */ package org.apache.bcel.classfile; @@ -25,7 +25,7 @@ import org.apache.bcel.Constants; /** * This class represents a MethodParameters attribute. - * + * * @see The class File Format : The MethodParameters Attribute * @since 6.0 */ @@ -39,7 +39,7 @@ public class MethodParameters extends At super(Constants.ATTR_METHOD_PARAMETERS, name_index, length, constant_pool); System.out.println("new MethodParameters"); - int parameters_count = file.readUnsignedShort(); + int parameters_count = file.readUnsignedByte(); parameters = new MethodParameter[parameters_count]; for (int i = 0; i < parameters_count; i++) { parameters[i] = new MethodParameter(file);