commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1702345 - in /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6: classfile/ generic/ verifier/structurals/
Date Thu, 10 Sep 2015 22:35:03 GMT
Author: sebb
Date: Thu Sep 10 22:35:02 2015
New Revision: 1702345

URL: http://svn.apache.org/r1702345
Log:
Revert to using public Object clone() for now

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AnnotationDefault.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Constant.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/EnclosingMethod.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/PMGClass.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ParameterAnnotations.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/RuntimeInvisibleAnnotations.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/RuntimeVisibleAnnotations.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ClassGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/CodeExceptionGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldGenOrMethodGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LineNumberGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LocalVariableGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/LocalVariables.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/OperandStack.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AnnotationDefault.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AnnotationDefault.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AnnotationDefault.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AnnotationDefault.java
Thu Sep 10 22:35:02 2015
@@ -83,7 +83,7 @@ public class AnnotationDefault extends A
 
     @Override
     public Attribute copy(ConstantPool _constant_pool) {
-        return clone();
+        return (Attribute) clone();
     }
 
     @Override

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java
Thu Sep 10 22:35:02 2015
@@ -322,7 +322,7 @@ public abstract class Attribute implemen
      * @return shallow copy of this attribute
      */
     @Override
-    public Attribute clone()
+    public Object clone()
     {
         Attribute attr = null;
         try

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Constant.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Constant.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Constant.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Constant.java
Thu Sep 10 22:35:02 2015
@@ -115,9 +115,9 @@ public abstract class Constant implement
 
 
     @Override
-    public Constant clone() {
+    public Object clone() {
         try {
-            return (Constant) super.clone();
+            return super.clone();
         } catch (CloneNotSupportedException e) {
             throw new Error("Clone Not Supported"); // never happens
         }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/EnclosingMethod.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/EnclosingMethod.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/EnclosingMethod.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/EnclosingMethod.java
Thu Sep 10 22:35:02 2015
@@ -62,7 +62,7 @@ public class EnclosingMethod extends Att
 
     @Override
     public Attribute copy(ConstantPool constant_pool) {
-        return clone();
+        return (Attribute) clone();
     }
 
     // Accessors

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/PMGClass.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/PMGClass.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/PMGClass.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/PMGClass.java
Thu Sep 10 22:35:02 2015
@@ -168,6 +168,6 @@ public final class PMGClass extends Attr
      */
     @Override
     public Attribute copy( ConstantPool _constant_pool ) {
-        return clone();
+        return (Attribute) clone();
     }
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ParameterAnnotations.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ParameterAnnotations.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ParameterAnnotations.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ParameterAnnotations.java
Thu Sep 10 22:35:02 2015
@@ -118,6 +118,6 @@ public abstract class ParameterAnnotatio
      */
     @Override
     public Attribute copy( ConstantPool constant_pool ) {
-        return clone();
+        return (Attribute) clone();
     }
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/RuntimeInvisibleAnnotations.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/RuntimeInvisibleAnnotations.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/RuntimeInvisibleAnnotations.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/RuntimeInvisibleAnnotations.java
Thu Sep 10 22:35:02 2015
@@ -54,7 +54,7 @@ public class RuntimeInvisibleAnnotations
     @Override
     public Attribute copy(ConstantPool constant_pool)
     {
-        return clone();
+        return (Attribute) clone();
     }
 
     @Override

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/RuntimeVisibleAnnotations.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/RuntimeVisibleAnnotations.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/RuntimeVisibleAnnotations.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/RuntimeVisibleAnnotations.java
Thu Sep 10 22:35:02 2015
@@ -53,7 +53,7 @@ public class RuntimeVisibleAnnotations e
     @Override
     public Attribute copy(ConstantPool constant_pool)
     {
-        return clone();
+        return (Attribute) clone();
     }
 
     @Override

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java
Thu Sep 10 22:35:02 2015
@@ -265,6 +265,6 @@ public final class Signature extends Att
      */
     @Override
     public Attribute copy( ConstantPool _constant_pool ) {
-        return clone();
+        return (Attribute) clone();
     }
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java
Thu Sep 10 22:35:02 2015
@@ -145,6 +145,6 @@ public final class SourceFile extends At
      */
     @Override
     public Attribute copy( ConstantPool _constant_pool ) {
-        return clone();
+        return (Attribute) clone();
     }
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ClassGen.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ClassGen.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ClassGen.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ClassGen.java
Thu Sep 10 22:35:02 2015
@@ -556,9 +556,9 @@ public class ClassGen extends AccessFlag
 
 
     @Override
-    public ClassGen clone() {
+    public Object clone() {
         try {
-            return (ClassGen) super.clone();
+            return super.clone();
         } catch (CloneNotSupportedException e) {
             throw new Error("Clone Not Supported"); // never happens
         }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/CodeExceptionGen.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/CodeExceptionGen.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/CodeExceptionGen.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/CodeExceptionGen.java
Thu Sep 10 22:35:02 2015
@@ -177,9 +177,9 @@ public final class CodeExceptionGen impl
 
 
     @Override
-    public CodeExceptionGen clone() {
+    public Object clone() {
         try {
-            return (CodeExceptionGen) super.clone();
+            return super.clone();
         } catch (CloneNotSupportedException e) {
             throw new Error("Clone Not Supported"); // never happens
         }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldGenOrMethodGen.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldGenOrMethodGen.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldGenOrMethodGen.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldGenOrMethodGen.java
Thu Sep 10 22:35:02 2015
@@ -181,9 +181,9 @@ public abstract class FieldGenOrMethodGe
 
 
     @Override
-    public FieldGenOrMethodGen clone() {
+    public Object clone() {
         try {
-            return (FieldGenOrMethodGen) super.clone();
+            return super.clone();
         } catch (CloneNotSupportedException e) {
             throw new Error("Clone Not Supported"); // never happens
         }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LineNumberGen.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LineNumberGen.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LineNumberGen.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LineNumberGen.java
Thu Sep 10 22:35:02 2015
@@ -87,9 +87,9 @@ public class LineNumberGen implements In
 
 
     @Override
-    public LineNumberGen clone() {
+    public Object clone() {
         try {
-            return (LineNumberGen) super.clone();
+            return super.clone();
         } catch (CloneNotSupportedException e) {
             throw new Error("Clone Not Supported"); // never happens
         }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LocalVariableGen.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LocalVariableGen.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LocalVariableGen.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LocalVariableGen.java
Thu Sep 10 22:35:02 2015
@@ -216,9 +216,9 @@ public class LocalVariableGen implements
 
 
     @Override
-    public LocalVariableGen clone() {
+    public Object clone() {
         try {
-            return (LocalVariableGen) super.clone();
+            return super.clone();
         } catch (CloneNotSupportedException e) {
             throw new Error("Clone Not Supported"); // never happens
         }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/LocalVariables.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/LocalVariables.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/LocalVariables.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/LocalVariables.java
Thu Sep 10 22:35:02 2015
@@ -49,7 +49,7 @@ public class LocalVariables implements C
      * However, the Type objects in the array are shared.
      */
     @Override
-    public LocalVariables clone(){
+    public Object clone(){
         LocalVariables lvs = new LocalVariables(locals.length);
         for (int i=0; i<locals.length; i++){
             lvs.locals[i] = this.locals[i];
@@ -69,7 +69,7 @@ public class LocalVariables implements C
      * This is equivalent to ((LocalVariables) this.clone()).
      */
     public LocalVariables getClone(){
-        return this.clone();
+        return (LocalVariables) this.clone();
     }
 
     /**

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/OperandStack.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/OperandStack.java?rev=1702345&r1=1702344&r2=1702345&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/OperandStack.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/OperandStack.java
Thu Sep 10 22:35:02 2015
@@ -62,16 +62,12 @@ public class OperandStack implements Clo
      * shared.
      */
     @Override
-    public OperandStack clone(){
-        try {
-            OperandStack newstack = (OperandStack) super.clone();
-            @SuppressWarnings("unchecked") // OK because this.stack is the same type
-            final ArrayList<Type> clone = (ArrayList<Type>) this.stack.clone();
-            newstack.stack = clone;
-            return newstack;
-        } catch (CloneNotSupportedException e) {
-            throw new Error("Clone Not Supported"); // never happens
-        }
+    public Object clone(){
+        OperandStack newstack = new OperandStack(this.maxStack);
+        @SuppressWarnings("unchecked") // OK because this.stack is the same type
+        final ArrayList<Type> clone = (ArrayList<Type>) this.stack.clone();
+        newstack.stack = clone;
+        return newstack;
     }
 
     /**
@@ -106,7 +102,7 @@ public class OperandStack implements Clo
      * @see #clone()
      */
     public OperandStack getClone(){
-        return this.clone();
+        return (OperandStack) this.clone();
     }
 
     /**



Mime
View raw message