svn commit: r292102 - /jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/FieldOrMethod.java

[email protected]
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
Author: dbrosius
Date: Tue Sep 27 20:12:38 2005
New Revision: 292102

URL: http://svn.apache.org/viewcvs?rev=292102&view=rev
Log:
better try/catch handling

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

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/FieldOrMethod.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/FieldOrMethod.java?rev=292102&r1=292101&r2=292102&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/FieldOrMethod.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/FieldOrMethod.java Tue Sep 27 20:12:38 2005
@@ -195,19 +195,19 @@
    * @return deep copy of this field
    */
   protected FieldOrMethod copy_(ConstantPool _constant_pool) {
-    FieldOrMethod c = null;
 
     try {
-      c = (FieldOrMethod)clone();
-    } catch (CloneNotSupportedException e) {
-    }
+      FieldOrMethod c = (FieldOrMethod)clone();
+      c.constant_pool = _constant_pool;
+      c.attributes = new Attribute[attributes_count];
 
-    c.constant_pool = _constant_pool;
-    c.attributes = new Attribute[attributes_count];
+      for (int i = 0; i < attributes_count; i++)
+        c.attributes[i] = attributes[i].copy(_constant_pool);
 
-    for (int i = 0; i < attributes_count; i++)
-      c.attributes[i] = attributes[i].copy(_constant_pool);
+      return c;
+    } catch (CloneNotSupportedException e) {
+      return null;
+    }
 
-    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.