You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/09/11 13:10:49 UTC
svn commit: r1702427 -
/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
Author: sebb
Date: Fri Sep 11 11:10:49 2015
New Revision: 1702427
URL: http://svn.apache.org/r1702427
Log:
Avoid NPE
Modified:
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java?rev=1702427&r1=1702426&r2=1702427&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java Fri Sep 11 11:10:49 2015
@@ -158,7 +158,7 @@ public abstract class FieldOrMethod exte
*/
public final void setAttributes( Attribute[] attributes ) {
this.attributes = attributes;
- this.attributes_count = attributes.length; // init deprecated field
+ this.attributes_count = attributes != null ? attributes.length : 0; // init deprecated field
}