openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r954697 - /openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Services.java
Date Tue, 15 Jun 2010 02:38:42 GMT
Author: dwoods
Date: Tue Jun 15 02:38:42 2010
New Revision: 954697

URL: http://svn.apache.org/viewvc?rev=954697&view=rev
Log:
OPENJPA-1700 FindBugs - Exception is caught when Exception is not thrown.  This method uses
a try-catch block that catches Exception objects, which could mask potential bugs.

Modified:
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Services.java

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Services.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Services.java?rev=954697&r1=954696&r2=954697&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Services.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Services.java Tue
Jun 15 02:38:42 2010
@@ -25,6 +25,7 @@ import java.io.InputStreamReader;
 import java.net.URL;
 import java.net.URLConnection;
 import java.security.AccessController;
+import java.security.PrivilegedActionException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Enumeration;
@@ -101,10 +102,12 @@ public class Services {
 
             return (String[]) resourceList.toArray(new String[resourceList
                 .size()]);
-        } catch (Exception e) {
+        } catch (PrivilegedActionException pae) {
+            // silently swallow all exceptions.
+        } catch (IOException ioe) {
             // silently swallow all exceptions.
-            return new String[0];
         }
+        return new String[0];
     }
 
     /**



Mime
View raw message