jakarta-bcel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r292102 - /jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/FieldOrMethod.java
Date Wed, 28 Sep 2005 03:12:52 GMT
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;
   }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Mime
View raw message