8023717: (process) ProcessBuilder should catch SecurityException rather than AccessControlException
authoralanb
Wed, 28 Aug 2013 14:07:30 +0100
changeset 19606 6c846d61ba2f
parent 19605 0f98f8e3bdcb
child 19607 bee007586d06
child 19820 9ee1d7810f50
8023717: (process) ProcessBuilder should catch SecurityException rather than AccessControlException Reviewed-by: wetmore, alanb Contributed-by: martinrb@google.com
jdk/src/share/classes/java/lang/ProcessBuilder.java
--- a/jdk/src/share/classes/java/lang/ProcessBuilder.java	Wed Aug 21 20:41:35 2013 -0700
+++ b/jdk/src/share/classes/java/lang/ProcessBuilder.java	Wed Aug 28 14:07:30 2013 +0100
@@ -29,7 +29,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.security.AccessControlException;
 import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.List;
@@ -1033,9 +1032,9 @@
                 // Can not disclose the fail reason for read-protected files.
                 try {
                     security.checkRead(prog);
-                } catch (AccessControlException ace) {
+                } catch (SecurityException se) {
                     exceptionInfo = "";
-                    cause = ace;
+                    cause = se;
                 }
             }
             // It's much easier for us to create a high-quality error