sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1397414 - in /sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util: Exceptions.java Locales.java resources/IndexedResourceBundle.java type/Types.java
Date Fri, 12 Oct 2012 01:42:04 GMT
Author: desruisseaux
Date: Fri Oct 12 01:42:03 2012
New Revision: 1397414

URL: http://svn.apache.org/viewvc?rev=1397414&view=rev
Log:
More accurate catch clause (JDK7 only).

Modified:
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Locales.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/type/Types.java

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java?rev=1397414&r1=1397413&r2=1397414&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java Fri Oct
12 01:42:03 2012
@@ -72,7 +72,7 @@ public final class Exceptions extends St
         final Throwable ne;
         try {
             ne = exception.getClass().getConstructor(String.class).newInstance(message);
-        } catch (Exception e) { // Too many exception for listing them all.
+        } catch (ReflectiveOperationException e) {
             return exception;
         }
         ne.setStackTrace(exception.getStackTrace());

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Locales.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Locales.java?rev=1397414&r1=1397413&r2=1397414&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Locales.java (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Locales.java Fri Oct 12
01:42:03 2012
@@ -77,7 +77,7 @@ public final class Locales extends Stati
                     }
                 }
             }
-        } catch (Exception exception) { // Too many exceptions for enumerating them.
+        } catch (ReflectiveOperationException exception) {
             /*
              * Not a big deal if this operation fails (this is actually just an
              * optimization for reducing memory usage). Log a warning and stop.

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1397414&r1=1397413&r2=1397414&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
(original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
Fri Oct 12 01:42:03 2012
@@ -213,7 +213,7 @@ public class IndexedResourceBundle exten
                         names[index] = field.getName();
                     }
                 }
-            } catch (Exception e) {
+            } catch (ReflectiveOperationException e) {
                 names = CharSequences.EMPTY_ARRAY;
             }
             keys = resize(names, length);
@@ -422,7 +422,7 @@ public class IndexedResourceBundle exten
              */
             try {
                 keyID = (Integer) getKeysClass().getField(key).get(null);
-            } catch (Exception e) {
+            } catch (ReflectiveOperationException e) {
                 e.addSuppressed(exception);
                 Logging.recoverableException(getClass(), "handleGetObject", e);
                 return null; // This is okay as of 'handleGetObject' contract.

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/type/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/type/Types.java?rev=1397414&r1=1397413&r2=1397414&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/type/Types.java (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/type/Types.java Fri Oct
12 01:42:03 2012
@@ -20,6 +20,7 @@ import java.util.Map;
 import java.util.HashMap;
 import java.util.Properties;
 import java.util.MissingResourceException;
+import java.io.IOException;
 import java.io.InputStream;
 
 import org.opengis.annotation.UML;
@@ -111,7 +112,7 @@ public final class Types extends Static 
             try {
                 props.load(in);
                 in.close();
-            } catch (Exception e) { // Catch IOException and IllegalArgumentException.
+            } catch (IOException | IllegalArgumentException e) {
                 throw new BackingStoreException(e);
             }
             typeForNames = new HashMap<>(props);



Mime
View raw message