svn commit: r230961 - /jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/JavaClass.java

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

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

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

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/JavaClass.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/JavaClass.java?rev=230961&r1=230960&r2=230961&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/JavaClass.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/JavaClass.java Mon Aug  8 20:43:46 2005
@@ -670,24 +670,24 @@
 
     try {
       c = (JavaClass)clone();
-    } catch (CloneNotSupportedException e) {
-    }
 
-    c.constant_pool = constant_pool.copy();
-    c.interfaces = (int[])interfaces.clone();
-    c.interface_names = (String[])interface_names.clone();
+      c.constant_pool = constant_pool.copy();
+      c.interfaces = (int[])interfaces.clone();
+      c.interface_names = (String[])interface_names.clone();
 
-    c.fields = new Field[fields.length];
-    for (int i = 0; i < fields.length; i++)
-      c.fields[i] = fields[i].copy(c.constant_pool);
+      c.fields = new Field[fields.length];
+      for (int i = 0; i < fields.length; i++)
+        c.fields[i] = fields[i].copy(c.constant_pool);
 
-    c.methods = new Method[methods.length];
-    for (int i = 0; i < methods.length; i++)
-      c.methods[i] = methods[i].copy(c.constant_pool);
+      c.methods = new Method[methods.length];
+      for (int i = 0; i < methods.length; i++)
+        c.methods[i] = methods[i].copy(c.constant_pool);
 
-    c.attributes = new Attribute[attributes.length];
-    for (int i = 0; i < attributes.length; i++)
-      c.attributes[i] = attributes[i].copy(c.constant_pool);
+      c.attributes = new Attribute[attributes.length];
+      for (int i = 0; i < attributes.length; i++)
+        c.attributes[i] = attributes[i].copy(c.constant_pool);
+    } catch (CloneNotSupportedException e) {
+    }
 
     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.