gemmellr commented on code in PR #5993:
URL: https://github.com/apache/activemq-artemis/pull/5993#discussion_r2448943302


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/sm/SecurityManagerShim.java:
##########
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.utils.sm;
+
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.Objects;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CompletionException;
+
+import javax.security.auth.Subject;
+
+/*
+ * SecurityManager related shim.
+ * This specific class uses legacy methods toward usage on Java 17 - 23.
+ *
+ * The API of this class must be kept the same as the Java 24+ implementation
+ * variant of this class which can be found at:
+ * 
src/main/java24/org/apache/activemq/artemis/utils/sm/SecurityManagerShim.java

Review Comment:
   We definitely could yes but I just opted against it, since then we need the 
third file and also then need to create an instance of the classes and first 
get it from every location this is being used since the usages are all static. 
(Initially I was also like, oh can I use a static interface method for probably 
the first time?...then realised no, since it would just mean two copies of the 
interface :P)
   
   I don't see it being much of an issue to keep these in sync since, since I 
dont really see them actually being changed much at all, other than to 
eventually to remove the SecurityManager methods whenever we actually delete 
the usages of it, or remove the shim entirely, e.g with switch to a Java 25 
minimum (perhaps if using netty 5 eventually becomes a thing 
https://github.com/netty/netty/pull/15676).



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to