svn commit: r230960 - /jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ConstantPool.java

[email protected]
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
Author: dbrosius
Date: Mon Aug  8 20:41:11 2005
New Revision: 230960

URL: http://svn.apache.org/viewcvs?rev=230960&view=rev
Log:
'guard' against npe's

Modified:
    jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ConstantPool.java

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ConstantPool.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ConstantPool.java?rev=230960&r1=230959&r2=230960&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ConstantPool.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ConstantPool.java Mon Aug  8 20:41:11 2005
@@ -323,14 +323,14 @@
 
     try {
       c = (ConstantPool)clone();
-    } catch(CloneNotSupportedException e) {}
+      c.constant_pool = new Constant[constant_pool_count];
 
-    c.constant_pool = new Constant[constant_pool_count];
+      for(int i=1; i < constant_pool_count; i++) {
+        if(constant_pool[i] != null)
+        	c.constant_pool[i] = constant_pool[i].copy();
+      }
+    } catch(CloneNotSupportedException e) {}
 
-    for(int i=1; i < constant_pool_count; i++) {
-      if(constant_pool[i] != null)
-	c.constant_pool[i] = constant_pool[i].copy();
-    }
 
     return c;
   }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.