Author: desruisseaux
Date: Sun Jan 22 05:50:27 2017
New Revision: 1779773

URL: http://svn.apache.org/viewvc?rev=1779773&view=rev
Log:
Override clone() as a matter of principle even if this is only for casting the 
result.
We do that only for public classes.

Modified:
    
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/TabularFormat.java
    
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java

Modified: 
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/TabularFormat.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/TabularFormat.java?rev=1779773&r1=1779772&r2=1779773&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/TabularFormat.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/TabularFormat.java
 [UTF-8] Sun Jan 22 05:50:27 2017
@@ -69,7 +69,6 @@ import org.apache.sis.util.resources.Err
  *
  * @see TableAppender
  */
-@SuppressWarnings("CloneableClassWithoutClone")   // Because this class does 
not contain field that need to be cloned.
 public abstract class TabularFormat<T> extends CompoundFormat<T> {
     /**
      * For cross-version compatibility.
@@ -331,4 +330,14 @@ scan:   for (int i=0; i<length; i++) {
         }
         return parsePattern.matcher(text);
     }
+
+    /**
+     * Returns a clone of this format.
+     *
+     * @return a clone of this format.
+     */
+    @Override
+    public TabularFormat<T> clone() {
+        return (TabularFormat<T>) super.clone();
+    }
 }

Modified: 
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java?rev=1779773&r1=1779772&r2=1779773&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java
 [UTF-8] Sun Jan 22 05:50:27 2017
@@ -51,7 +51,6 @@ import static java.lang.Math.*;
  * @version 0.3
  * @module
  */
-@SuppressWarnings("CloneableClassWithoutClone")   // Because this class does 
not contain field that need to be cloned.
 public class StatisticsFormat extends TabularFormat<Statistics> {
     /**
      * For cross-version compatibility.
@@ -442,4 +441,14 @@ public class StatisticsFormat extends Ta
         format.setMinimumFractionDigits(digits);
         format.setMaximumFractionDigits(digits);
     }
+
+    /**
+     * Returns a clone of this format.
+     *
+     * @return a clone of this format.
+     */
+    @Override
+    public StatisticsFormat clone() {
+        return (StatisticsFormat) super.clone();
+    }
 }


Reply via email to