risdenk commented on code in PR #2919:
URL: https://github.com/apache/calcite/pull/2919#discussion_r1065934450


##########
core/src/main/java/org/apache/calcite/util/Util.java:
##########
@@ -1048,6 +1048,22 @@ public static String getStackTrace(Throwable t) {
     return sw.toString();
   }
 
+  /**
+   * Ignores the RuntimeException if it is an AccessControlException otherwise 
throws.
+   *
+   * <p>Checks a RuntimeException for AccessControlException without importing 
JDK
+   * classes that are deprecated in <a href="https://openjdk.org/jeps/411";>JDK 
17</a>
+   * with the anticipated removal of Java security manager.
+   *
+   * @param e RuntimeException to check if it is an AccessControlException
+   */
+  @API(since = "1.33", status = API.Status.EXPERIMENTAL)
+  public static void ignoreAccessControlException(RuntimeException e) {
+    if 
(!"java.security.AccessControlException".equals(e.getClass().getName())) {
+      throw e;
+    }
+  }

Review Comment:
   Seems like a reasonable idea. From https://openjdk.org/jeps/411
   
   ```
   ...
   We will not deprecate some classes in the java.security package that are 
related to the Security Manager, for various reasons:
   ...
   SecurityException — A runtime exception thrown by Java APIs when a 
permission check fails. We may deprecate this API for removal at a later date, 
but for now the impact of doing so would be too high.
   ...
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to