groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] branch master updated: Fix spotbugs warnings: tuple classes implement `Cloneable` but does not define or use `clone` method
Date Sat, 04 May 2019 08:43:23 GMT
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 515546e  Fix spotbugs warnings: tuple classes implement `Cloneable` but does not
define or use `clone` method
515546e is described below

commit 515546ed500b88ffd7bf6e4b099ae7e89069ca5a
Author: Daniel Sun <sunlan@apache.org>
AuthorDate: Sat May 4 16:42:59 2019 +0800

    Fix spotbugs warnings: tuple classes implement `Cloneable` but does not define or use
`clone` method
---
 src/main/groovy/groovy/lang/Tuple.java   | 4 ++++
 src/main/groovy/groovy/lang/Tuple0.java  | 4 ++++
 src/main/groovy/groovy/lang/Tuple1.java  | 5 +++++
 src/main/groovy/groovy/lang/Tuple10.java | 4 ++++
 src/main/groovy/groovy/lang/Tuple11.java | 5 +++++
 src/main/groovy/groovy/lang/Tuple12.java | 5 +++++
 src/main/groovy/groovy/lang/Tuple13.java | 4 ++++
 src/main/groovy/groovy/lang/Tuple14.java | 4 ++++
 src/main/groovy/groovy/lang/Tuple15.java | 4 ++++
 src/main/groovy/groovy/lang/Tuple16.java | 5 +++++
 src/main/groovy/groovy/lang/Tuple2.java  | 4 ++++
 src/main/groovy/groovy/lang/Tuple3.java  | 4 ++++
 src/main/groovy/groovy/lang/Tuple4.java  | 4 ++++
 src/main/groovy/groovy/lang/Tuple5.java  | 4 ++++
 src/main/groovy/groovy/lang/Tuple6.java  | 4 ++++
 src/main/groovy/groovy/lang/Tuple7.java  | 4 ++++
 src/main/groovy/groovy/lang/Tuple8.java  | 4 ++++
 src/main/groovy/groovy/lang/Tuple9.java  | 4 ++++
 18 files changed, 76 insertions(+)

diff --git a/src/main/groovy/groovy/lang/Tuple.java b/src/main/groovy/groovy/lang/Tuple.java
index fc90fc0..4e06ab1 100644
--- a/src/main/groovy/groovy/lang/Tuple.java
+++ b/src/main/groovy/groovy/lang/Tuple.java
@@ -237,4 +237,8 @@ public class Tuple<E> extends AbstractList<E> implements Serializable,
Cloneable
         return new Tuple16<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
v14, v15, v16);
     }
 
+    @Override
+    public Tuple<E> clone() {
+        return new Tuple<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple0.java b/src/main/groovy/groovy/lang/Tuple0.java
index 4901d79..18c88ee 100644
--- a/src/main/groovy/groovy/lang/Tuple0.java
+++ b/src/main/groovy/groovy/lang/Tuple0.java
@@ -29,4 +29,8 @@ public final class Tuple0 extends Tuple {
 
     private Tuple0() {}
 
+    @Override
+    public Tuple0 clone() {
+        return INSTANCE;
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple1.java b/src/main/groovy/groovy/lang/Tuple1.java
index e628e89..200eb1b 100644
--- a/src/main/groovy/groovy/lang/Tuple1.java
+++ b/src/main/groovy/groovy/lang/Tuple1.java
@@ -45,4 +45,9 @@ public final class Tuple1<T1> extends Tuple {
     public T1 getV1() {
         return v1;
     }
+
+    @Override
+    public Tuple1<T1> clone() {
+        return new Tuple1<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple10.java b/src/main/groovy/groovy/lang/Tuple10.java
index 26f3d4e..5356f13 100644
--- a/src/main/groovy/groovy/lang/Tuple10.java
+++ b/src/main/groovy/groovy/lang/Tuple10.java
@@ -97,4 +97,8 @@ public final class Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
extends Tupl
         return v10;
     }
 
+    @Override
+    public Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> clone() {
+        return new Tuple10<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple11.java b/src/main/groovy/groovy/lang/Tuple11.java
index fbad268..42e580c 100644
--- a/src/main/groovy/groovy/lang/Tuple11.java
+++ b/src/main/groovy/groovy/lang/Tuple11.java
@@ -102,4 +102,9 @@ public final class Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
T11> extends
     public T11 getV11() {
         return v11;
     }
+
+    @Override
+    public Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> clone() {
+        return new Tuple11<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple12.java b/src/main/groovy/groovy/lang/Tuple12.java
index 7d0a40b..4be67ba 100644
--- a/src/main/groovy/groovy/lang/Tuple12.java
+++ b/src/main/groovy/groovy/lang/Tuple12.java
@@ -109,4 +109,9 @@ public final class Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
T11, T12> ex
     public T12 getV12() {
         return v12;
     }
+
+    @Override
+    public Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> clone() {
+        return new Tuple12<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple13.java b/src/main/groovy/groovy/lang/Tuple13.java
index fedfd6d..e40b1a6 100644
--- a/src/main/groovy/groovy/lang/Tuple13.java
+++ b/src/main/groovy/groovy/lang/Tuple13.java
@@ -116,4 +116,8 @@ public final class Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
T11, T12, T1
         return v13;
     }
 
+    @Override
+    public Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> clone()
{
+        return new Tuple13<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple14.java b/src/main/groovy/groovy/lang/Tuple14.java
index c945545..c0cfb16 100644
--- a/src/main/groovy/groovy/lang/Tuple14.java
+++ b/src/main/groovy/groovy/lang/Tuple14.java
@@ -121,4 +121,8 @@ public final class Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
T11, T12, T1
         return v14;
     }
 
+    @Override
+    public Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> clone()
{
+        return new Tuple14<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple15.java b/src/main/groovy/groovy/lang/Tuple15.java
index 5589d77..02f91e3 100644
--- a/src/main/groovy/groovy/lang/Tuple15.java
+++ b/src/main/groovy/groovy/lang/Tuple15.java
@@ -127,4 +127,8 @@ public final class Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
T11, T12, T1
         return v15;
     }
 
+    @Override
+    public Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>
clone() {
+        return new Tuple15<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple16.java b/src/main/groovy/groovy/lang/Tuple16.java
index 3cbecce..64ae7fc 100644
--- a/src/main/groovy/groovy/lang/Tuple16.java
+++ b/src/main/groovy/groovy/lang/Tuple16.java
@@ -132,4 +132,9 @@ public final class Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
T11, T12, T1
     public T16 getV16() {
         return v16;
     }
+
+    @Override
+    public Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>
clone() {
+        return new Tuple16<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple2.java b/src/main/groovy/groovy/lang/Tuple2.java
index e1e87e9..0963b6e 100644
--- a/src/main/groovy/groovy/lang/Tuple2.java
+++ b/src/main/groovy/groovy/lang/Tuple2.java
@@ -55,4 +55,8 @@ public final class Tuple2<T1, T2> extends Tuple {
         return v2;
     }
 
+    @Override
+    public Tuple2<T1, T2> clone() {
+        return new Tuple2<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple3.java b/src/main/groovy/groovy/lang/Tuple3.java
index 6e55651..d2a91de 100644
--- a/src/main/groovy/groovy/lang/Tuple3.java
+++ b/src/main/groovy/groovy/lang/Tuple3.java
@@ -69,4 +69,8 @@ public final class Tuple3<T1, T2, T3> extends Tuple {
         return v3;
     }
 
+    @Override
+    public Tuple3<T1, T2, T3> clone() {
+        return new Tuple3<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple4.java b/src/main/groovy/groovy/lang/Tuple4.java
index 8c564b7..8d89c07 100644
--- a/src/main/groovy/groovy/lang/Tuple4.java
+++ b/src/main/groovy/groovy/lang/Tuple4.java
@@ -80,4 +80,8 @@ public final class Tuple4<T1, T2, T3, T4> extends Tuple {
         return v4;
     }
 
+    @Override
+    public Tuple4<T1, T2, T3, T4> clone() {
+        return new Tuple4<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple5.java b/src/main/groovy/groovy/lang/Tuple5.java
index b4e9cc6..d9f2d3c 100644
--- a/src/main/groovy/groovy/lang/Tuple5.java
+++ b/src/main/groovy/groovy/lang/Tuple5.java
@@ -91,4 +91,8 @@ public final class Tuple5<T1, T2, T3, T4, T5> extends Tuple {
         return v5;
     }
 
+    @Override
+    public Tuple5<T1, T2, T3, T4, T5> clone() {
+        return new Tuple5<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple6.java b/src/main/groovy/groovy/lang/Tuple6.java
index 04258ff..8cb786f 100644
--- a/src/main/groovy/groovy/lang/Tuple6.java
+++ b/src/main/groovy/groovy/lang/Tuple6.java
@@ -102,4 +102,8 @@ public final class Tuple6<T1, T2, T3, T4, T5, T6> extends Tuple
{
         return v6;
     }
 
+    @Override
+    public Tuple6<T1, T2, T3, T4, T5, T6> clone() {
+        return new Tuple6<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple7.java b/src/main/groovy/groovy/lang/Tuple7.java
index b609c07..d73f4dd 100644
--- a/src/main/groovy/groovy/lang/Tuple7.java
+++ b/src/main/groovy/groovy/lang/Tuple7.java
@@ -113,4 +113,8 @@ public final class Tuple7<T1, T2, T3, T4, T5, T6, T7> extends Tuple
{
         return v7;
     }
 
+    @Override
+    public Tuple7<T1, T2, T3, T4, T5, T6, T7> clone() {
+        return new Tuple7<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple8.java b/src/main/groovy/groovy/lang/Tuple8.java
index 28caa86..672ed24 100644
--- a/src/main/groovy/groovy/lang/Tuple8.java
+++ b/src/main/groovy/groovy/lang/Tuple8.java
@@ -124,4 +124,8 @@ public final class Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> extends
Tuple {
         return v8;
     }
 
+    @Override
+    public Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> clone() {
+        return new Tuple8<>(this);
+    }
 }
diff --git a/src/main/groovy/groovy/lang/Tuple9.java b/src/main/groovy/groovy/lang/Tuple9.java
index 0af366c..b318926 100644
--- a/src/main/groovy/groovy/lang/Tuple9.java
+++ b/src/main/groovy/groovy/lang/Tuple9.java
@@ -136,4 +136,8 @@ public final class Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> extends
Tuple {
         return v9;
     }
 
+    @Override
+    public Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> clone() {
+        return new Tuple9<>(this);
+    }
 }


Mime
View raw message