commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r1066333 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
Date Wed, 02 Feb 2011 05:54:51 GMT
Author: bayard
Date: Wed Feb  2 05:54:51 2011
New Revision: 1066333

URL: http://svn.apache.org/viewvc?rev=1066333&view=rev
Log:
Explicitly specifying the Exceptions instead of a catch(Exception)

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=1066333&r1=1066332&r2=1066333&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Wed
Feb  2 05:54:51 2011
@@ -723,7 +723,13 @@ public class StringUtils {
             Class<?> normalizerClass = Thread.currentThread().getContextClassLoader().loadClass("java.text.Normalizer");//$NON-NLS-1$
             java6NormalizeMethod = normalizerClass.getMethod("normalize", new Class[] {CharSequence.class,
normalizerFormClass});//$NON-NLS-1$
             java6Available = true;
-        } catch (Exception e) {
+        } catch (ClassNotFoundException e) {
+            java6Available = false;
+        } catch (NoSuchFieldException e) {
+            java6Available = false;
+        } catch (IllegalAccessException e) {
+            java6Available = false;
+        } catch (NoSuchMethodException e) {
             java6Available = false;
         }
 
@@ -732,7 +738,9 @@ public class StringUtils {
             Class<?> normalizerClass = Thread.currentThread().getContextClassLoader().loadClass("sun.text.Normalizer");//$NON-NLS-1$
             sunDecomposeMethod = normalizerClass.getMethod("decompose", new Class[] {String.class,
Boolean.TYPE, Integer.TYPE});//$NON-NLS-1$
             sunAvailable = true;
-        } catch (Exception e) {
+        } catch (ClassNotFoundException e) {
+            sunAvailable = false;
+        } catch (NoSuchMethodException e) {
             sunAvailable = false;
         }
     }



Mime
View raw message