Skip to content

Commit a7eac1f

Browse files
committed
Remove legacy Java Security Manager use, since JWS and Applets are dead
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
1 parent 6b4a488 commit a7eac1f

File tree

5 files changed

+5
-15
lines changed

5 files changed

+5
-15
lines changed

client/src/com/mirth/connect/client/ui/OSXAdapter.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@
5252
import java.lang.reflect.InvocationTargetException;
5353
import java.lang.reflect.Method;
5454
import java.lang.reflect.Proxy;
55-
import java.security.AccessController;
5655
import java.util.List;
5756

5857
import org.apache.commons.lang3.math.NumberUtils;
59-
import org.glassfish.jersey.internal.util.ReflectionHelper;
6058

6159
public class OSXAdapter implements InvocationHandler {
6260

@@ -280,7 +278,7 @@ protected static Object getApplication() throws Exception {
280278

281279
protected static void setHandler(InvocationHandler adapter, String interfaceName, String applicationSetter) throws Exception {
282280
Class<?> handlerInterface = Class.forName(interfaceName);
283-
Object handlerImpl = Proxy.newProxyInstance(AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(handlerInterface)), new Class[] {
281+
Object handlerImpl = Proxy.newProxyInstance(handlerInterface.getClassLoader(), new Class[] {
284282
handlerInterface }, adapter);
285283
Object application = getApplication();
286284
application.getClass().getMethod(applicationSetter, handlerInterface).invoke(application, handlerImpl);

client/src/com/mirth/connect/client/ui/panels/connectors/ConnectorSettingsPanel.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import java.lang.reflect.InvocationTargetException;
1414
import java.lang.reflect.Method;
1515
import java.lang.reflect.Proxy;
16-
import java.security.AccessController;
1716
import java.util.ArrayList;
1817
import java.util.List;
1918
import java.util.Map;
@@ -23,8 +22,6 @@
2322
import javax.swing.JPanel;
2423
import javax.swing.SwingWorker;
2524

26-
import org.glassfish.jersey.internal.util.ReflectionHelper;
27-
2825
import com.mirth.connect.client.core.ClientException;
2926
import com.mirth.connect.client.ui.ConnectorTypeDecoration;
3027
import com.mirth.connect.client.ui.PlatformUI;
@@ -199,7 +196,7 @@ public final <T> T getServlet(final Class<T> servletInterface, final String work
199196
*/
200197
@SuppressWarnings("unchecked")
201198
public final <T> T getServlet(final Class<T> servletInterface, final String workerDisplayText, final String errorText, final ResponseHandler responseHandler, final String workerId) {
202-
return (T) Proxy.newProxyInstance(AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(servletInterface)), new Class[] {
199+
return (T) Proxy.newProxyInstance(servletInterface.getClassLoader(), new Class[] {
203200
servletInterface }, new InvocationHandler() {
204201
@Override
205202
public Object invoke(final Object proxy, final Method method, final Object[] args) throws ClientException {

server/src/com/mirth/connect/client/core/Client.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.lang.reflect.Proxy;
2020
import java.net.URI;
2121
import java.net.URISyntaxException;
22-
import java.security.AccessController;
2322
import java.security.Provider;
2423
import java.text.SimpleDateFormat;
2524
import java.util.Calendar;
@@ -51,7 +50,6 @@
5150
import org.glassfish.jersey.client.proxy.WebResourceFactory;
5251
import org.glassfish.jersey.client.spi.Connector;
5352
import org.glassfish.jersey.client.spi.ConnectorProvider;
54-
import org.glassfish.jersey.internal.util.ReflectionHelper;
5553
import org.glassfish.jersey.media.multipart.MultiPartFeature;
5654
import org.reflections.Reflections;
5755

@@ -245,7 +243,7 @@ public <T> T getServlet(Class<T> servletInterface, ExecuteType executeType) {
245243

246244
@SuppressWarnings("unchecked")
247245
public <T> T getServlet(final Class<T> servletInterface, final ExecuteType executeType, final Map<String, List<String>> customHeaders) {
248-
return (T) Proxy.newProxyInstance(AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(servletInterface)), new Class[] {
246+
return (T) Proxy.newProxyInstance(servletInterface.getClassLoader(), new Class[] {
249247
servletInterface }, new InvocationHandler() {
250248
@Override
251249
public Object invoke(Object proxy, Method method, Object[] args) throws ClientException {

server/src/com/mirth/connect/server/util/javascript/MirthJavaScriptThreadFactory.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ public class MirthJavaScriptThreadFactory implements ThreadFactory {
1919
private final String namePrefix;
2020

2121
MirthJavaScriptThreadFactory() {
22-
SecurityManager securityManager = System.getSecurityManager();
23-
group = (securityManager != null) ? securityManager.getThreadGroup() : Thread.currentThread().getThreadGroup();
22+
group = Thread.currentThread().getThreadGroup();
2423
namePrefix = "pool-" + poolNumber.getAndIncrement() + "-thread-";
2524
}
2625

server/src/org/glassfish/jersey/client/proxy/WebResourceFactory.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import java.lang.reflect.ParameterizedType;
5151
import java.lang.reflect.Proxy;
5252
import java.lang.reflect.Type;
53-
import java.security.AccessController;
5453
import java.util.Arrays;
5554
import java.util.Collection;
5655
import java.util.Collections;
@@ -82,7 +81,6 @@
8281
import javax.ws.rs.core.MultivaluedHashMap;
8382
import javax.ws.rs.core.MultivaluedMap;
8483

85-
import org.glassfish.jersey.internal.util.ReflectionHelper;
8684
import org.glassfish.jersey.media.multipart.Boundary;
8785
import org.glassfish.jersey.media.multipart.FormDataMultiPart;
8886
import org.glassfish.jersey.media.multipart.FormDataParam;
@@ -148,7 +146,7 @@ public static <C> C newResource(final Class<C> resourceInterface,
148146
final List<Cookie> cookies,
149147
final Form form) {
150148

151-
return (C) Proxy.newProxyInstance(AccessController.doPrivileged(ReflectionHelper.getClassLoaderPA(resourceInterface)),
149+
return (C) Proxy.newProxyInstance(resourceInterface.getClassLoader(),
152150
new Class[] {resourceInterface},
153151
new WebResourceFactory(ignoreResourcePath ? target : addPathFromAnnotation(resourceInterface, target),
154152
headers, cookies, form));

0 commit comments

Comments
 (0)