commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
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 GMT
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 <action> type attribute can be add,u
       <action issue="BCEL-174" type="fix">
         Verification of interfaces with default methods fails with Java 8
       </action>
+      <action issue="BCEL-177" type="fix" dev="markt">
+        When reading the number of parameters in a MethodParameters structure
+        only read a single byte as per the JVM specification.
+      </action>
     </release>
   </body>
 </document>

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 <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.24">The
class File Format : The MethodParameters Attribute</a>
  * @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);



Mime
View raw message