sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1452316 - in /sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata: Cloner.java PropertyAccessor.java
Date Mon, 04 Mar 2013 14:09:36 GMT
Author: desruisseaux
Date: Mon Mar  4 14:09:35 2013
New Revision: 1452316

URL: http://svn.apache.org/r1452316
Log:
Let Cloner.clone(...) propagate CloneNotSupportedException.

Modified:
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java?rev=1452316&r1=1452315&r2=1452316&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java [UTF-8]
(original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java [UTF-8]
Mon Mar  4 14:09:35 2013
@@ -71,7 +71,7 @@ final class Cloner extends org.apache.si
      * @return A presumed immutable view of the specified object.
      */
     @Override
-    public Object clone(final Object object) {
+    public Object clone(final Object object) throws CloneNotSupportedException {
         /*
          * CASE 1 - The object is an implementation of ModifiableMetadata. It may have
          *          its own algorithm for creating an unmodifiable view of metadata.
@@ -125,10 +125,8 @@ final class Cloner extends org.apache.si
         /*
          * CASE 4 - The object is presumed cloneable.
          */
-        if (object instanceof Cloneable) try {
+        if (object instanceof Cloneable) {
             return super.clone(object);
-        } catch (CloneNotSupportedException e) {
-            throw new UnsupportedOperationException(e);
         }
         /*
          * CASE 5 - Any other case. The object is assumed immutable and returned unchanged.

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java?rev=1452316&r1=1452315&r2=1452316&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
[UTF-8] Mon Mar  4 14:09:35 2013
@@ -1037,7 +1037,7 @@ final class PropertyAccessor {
      */
     final void freeze(final Object metadata) throws BackingStoreException {
         assert implementation.isInstance(metadata) : metadata;
-        if (setters != null) {
+        if (setters != null) try {
             final Object[] arguments = new Object[1];
             final Cloner cloner = new Cloner();
             for (int i=0; i<allCount; i++) {
@@ -1060,6 +1060,8 @@ final class PropertyAccessor {
                     }
                 }
             }
+        } catch (CloneNotSupportedException e) {
+            throw new UnsupportedOperationException(e);
         }
     }
 



Mime
View raw message