diff options
author | Sven Gothel <[email protected]> | 2023-01-14 21:31:45 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-01-14 21:31:45 +0100 |
commit | 72a8be591d5daba1e4e231c386812c543d503fce (patch) | |
tree | b4a08e451741eab5a9cad4617e2151bdfd8f5223 | |
parent | 4dfe7369d8e58978dc56235344731f927a1c8ae4 (diff) |
Replace AccessController.doPrivileged() w/ SecurityUtil.doPrivileged()
42 files changed, 89 insertions, 83 deletions
diff --git a/make/config/jogl/cg-common-CustomJavaCode.java b/make/config/jogl/cg-common-CustomJavaCode.java index cc1fefd1a..f8238d7dd 100644 --- a/make/config/jogl/cg-common-CustomJavaCode.java +++ b/make/config/jogl/cg-common-CustomJavaCode.java @@ -7,7 +7,7 @@ static { throw new RuntimeException("Couldn't instantiate CgProcAddressTable"); } - cgDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() { + cgDynamicLookupHelper = SecurityUtil.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() { public DynamicLibraryBundle run() { return new DynamicLibraryBundle(new CgDynamicLibraryBundleInfo()); } } ); diff --git a/make/config/jogl/cg-common.cfg b/make/config/jogl/cg-common.cfg index d6a5367a6..aba9a87d1 100644 --- a/make/config/jogl/cg-common.cfg +++ b/make/config/jogl/cg-common.cfg @@ -104,9 +104,9 @@ Ignore cgGetProgramOptions Import jogamp.opengl.* Import com.jogamp.common.os.DynamicLookupHelper Import com.jogamp.common.os.DynamicLibraryBundle +Import com.jogamp.common.util.SecurityUtil Import com.jogamp.opengl.cg.CgDynamicLibraryBundleInfo Import java.security.PrivilegedAction -Import java.security.AccessController # # NIODirectOnly directives for routines requiring them for semantic reasons diff --git a/make/config/jogl/glu-CustomJavaCode-gl2.java b/make/config/jogl/glu-CustomJavaCode-gl2.java index 2ade45c0e..f64a1f0bf 100644 --- a/make/config/jogl/glu-CustomJavaCode-gl2.java +++ b/make/config/jogl/glu-CustomJavaCode-gl2.java @@ -1,7 +1,7 @@ private static boolean useJavaMipmapCode = true; static { - AccessController.doPrivileged(new PrivilegedAction() { + SecurityUtil.doPrivileged(new PrivilegedAction() { public Object run() { String val = System.getProperty("jogl.glu.nojava"); if (val != null && !val.toLowerCase().equals("false")) { diff --git a/make/config/jogl/glu-CustomJavaCode-gl2es1.java b/make/config/jogl/glu-CustomJavaCode-gl2es1.java index 41a7e5b9b..b8d40e1f8 100644 --- a/make/config/jogl/glu-CustomJavaCode-gl2es1.java +++ b/make/config/jogl/glu-CustomJavaCode-gl2es1.java @@ -2,7 +2,7 @@ private static boolean useJavaMipmapCode = true; static { - AccessController.doPrivileged(new PrivilegedAction() { + SecurityUtil.doPrivileged(new PrivilegedAction() { public Object run() { String val = System.getProperty("jogl.glu.nojava"); if (val != null && !val.toLowerCase().equals("false")) { diff --git a/make/config/jogl/glu-gl2.cfg b/make/config/jogl/glu-gl2.cfg index 7c8735ff1..c38f6a6b4 100644 --- a/make/config/jogl/glu-gl2.cfg +++ b/make/config/jogl/glu-gl2.cfg @@ -38,6 +38,7 @@ ManualStaticInitCall GLUgl2 # GLU needs access to the GLUtesselatorImpl class for GLUtesselator, # to the Mipmap class for scaling and mipmap generation, # and to the nurbs.* package for the NURBS functionality +Import com.jogamp.common.util.SecurityUtil Import jogamp.opengl.glu.nurbs.* Import java.security.* Import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver diff --git a/make/config/nativewindow/jawt-CustomJavaCode.java b/make/config/nativewindow/jawt-CustomJavaCode.java index 6ea57dca2..16bce36e3 100644 --- a/make/config/nativewindow/jawt-CustomJavaCode.java +++ b/make/config/nativewindow/jawt-CustomJavaCode.java @@ -9,7 +9,7 @@ protected static boolean getJAWT(final JAWT jawt, final int jawt_version_flags) // Workaround for 4845371. // Make sure the first reference to the JNI GetDirectBufferAddress is done // from a privileged context so the VM's internal class lookups will succeed. - return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Boolean>() { public Boolean run() { jawt.setVersion(jawt_version_flags); if (JAWTFactory.JAWT_GetAWT(jawt)) { diff --git a/make/config/nativewindow/jawt-common.cfg b/make/config/nativewindow/jawt-common.cfg index 41129e630..adb6ce49b 100644 --- a/make/config/nativewindow/jawt-common.cfg +++ b/make/config/nativewindow/jawt-common.cfg @@ -25,5 +25,6 @@ import java.security.* import jogamp.nativewindow.jawt.* import com.jogamp.common.os.Platform import com.jogamp.common.util.VersionNumber +Import com.jogamp.common.util.SecurityUtil IncludeAs CustomJavaCode JAWT_DrawingSurfaceInfo jawt-DrawingSurfaceInfo-CustomJavaCode.java diff --git a/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java b/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java index 691a93a16..816974191 100644 --- a/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java +++ b/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java @@ -2,7 +2,7 @@ static final DynamicLibraryBundle dynamicLookupHelper; static { - dynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() { + dynamicLookupHelper = SecurityUtil.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() { public DynamicLibraryBundle run() { final DynamicLibraryBundle bundle = new DynamicLibraryBundle(new OVRDynamicLibraryBundleInfo()); if(null==bundle) { diff --git a/make/config/oculusvr/oculusvr.cfg b/make/config/oculusvr/oculusvr.cfg index d2d446f21..b2870e59a 100644 --- a/make/config/oculusvr/oculusvr.cfg +++ b/make/config/oculusvr/oculusvr.cfg @@ -5,7 +5,7 @@ Style AllStatic JavaClass OVR Import com.jogamp.oculusvr.* -Import java.security.AccessController +Import com.jogamp.common.util.SecurityUtil Import java.security.PrivilegedAction IncludeAs CustomJavaCode OVR oculusvr-ovr-CustomJavaCode.java diff --git a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java index 76badcda8..5c317bd2b 100644 --- a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java +++ b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java @@ -32,13 +32,13 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.net.Uri; import com.jogamp.common.util.IOUtil; import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.cache.TempJarCache; import jogamp.graph.font.FontConstructor; @@ -141,7 +141,7 @@ public class FontFactory { final int[] streamLen = { 0 }; final File tempFile[] = { null }; - final InputStream bis = AccessController.doPrivileged(new PrivilegedAction<InputStream>() { + final InputStream bis = SecurityUtil.doPrivileged(new PrivilegedAction<InputStream>() { @Override public InputStream run() { InputStream bis = null; @@ -179,7 +179,7 @@ public class FontFactory { bis.close(); } if( null != tempFile[0] ) { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { tempFile[0].delete(); diff --git a/src/jogl/classes/com/jogamp/opengl/GLProfile.java b/src/jogl/classes/com/jogamp/opengl/GLProfile.java index 8612fc73f..27480cb53 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLProfile.java +++ b/src/jogl/classes/com/jogamp/opengl/GLProfile.java @@ -48,6 +48,7 @@ import com.jogamp.common.jvm.JNILibLoaderBase; import com.jogamp.common.os.Platform; import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionUtil; import com.jogamp.common.util.cache.TempJarCache; import com.jogamp.common.util.locks.LockFactory; @@ -62,7 +63,6 @@ import com.jogamp.nativewindow.NativeWindowFactory; import com.jogamp.opengl.fixedfunc.GLPointerFunc; import java.lang.reflect.Constructor; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.HashMap; import java.util.List; @@ -222,7 +222,7 @@ public class GLProfile { // run the whole static initialization privileged to speed up, // since this skips checking further access - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { Platform.initSingleton(); diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java index 5e6338b5c..52b207b0c 100644 --- a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java @@ -33,16 +33,16 @@ import com.jogamp.common.os.DynamicLibraryBundle; import com.jogamp.common.os.DynamicLibraryBundleInfo; import com.jogamp.common.os.Platform; import com.jogamp.common.util.RunnableExecutor; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.cache.TempJarCache; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.*; public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { private static final List<String> glueLibNames; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { Platform.initSingleton(); diff --git a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java index 68586dfc5..36d35cde9 100644 --- a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java +++ b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java @@ -32,12 +32,12 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.opengl.GLException; import com.jogamp.common.util.IntObjectHashMap; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.graph.font.Font; import com.jogamp.graph.font.FontSet; import com.jogamp.graph.font.FontFactory; @@ -68,7 +68,7 @@ public class JavaFontLoader implements FontSet { final String javaFontPath; private JavaFontLoader() { - final String javaHome = AccessController.doPrivileged(new PrivilegedAction<String>() { + final String javaHome = SecurityUtil.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return System.getProperty("java.home"); @@ -158,7 +158,7 @@ public class JavaFontLoader implements FontSet { private Font abspathImpl(final String fname, final int family, final int style) throws IOException { final Exception[] privErr = { null }; final int[] streamLen = { 0 }; - final InputStream stream = AccessController.doPrivileged(new PrivilegedAction<InputStream>() { + final InputStream stream = SecurityUtil.doPrivileged(new PrivilegedAction<InputStream>() { @Override public InputStream run() { try { diff --git a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java index 78140df6f..71d18b17e 100644 --- a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java +++ b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java @@ -36,12 +36,12 @@ import com.jogamp.common.os.Platform; import com.jogamp.common.util.IOUtil; import com.jogamp.common.util.IntObjectHashMap; import com.jogamp.common.util.JarUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.cache.TempJarCache; import com.jogamp.graph.font.Font; import com.jogamp.graph.font.FontSet; import com.jogamp.graph.font.FontFactory; -import java.security.AccessController; import java.security.PrivilegedAction; public class UbuntuFontLoader implements FontSet { @@ -139,7 +139,7 @@ public class UbuntuFontLoader implements FontSet { if( TempJarCache.isInitialized(false) ) { try { final Uri uri = JarUtil.getRelativeOf(UbuntuFontLoader.class, jarSubDir, jarName); - final Exception e0 = AccessController.doPrivileged(new PrivilegedAction<Exception>() { + final Exception e0 = SecurityUtil.doPrivileged(new PrivilegedAction<Exception>() { @Override public Exception run() { try { @@ -173,7 +173,7 @@ public class UbuntuFontLoader implements FontSet { final InputStream stream; if( useTempJARCache ) { final Exception[] privErr = { null }; - stream = AccessController.doPrivileged(new PrivilegedAction<InputStream>() { + stream = SecurityUtil.doPrivileged(new PrivilegedAction<InputStream>() { @Override public InputStream run() { try { diff --git a/src/jogl/classes/jogamp/opengl/Debug.java b/src/jogl/classes/jogamp/opengl/Debug.java index 5273eead7..cc239fefc 100644 --- a/src/jogl/classes/jogamp/opengl/Debug.java +++ b/src/jogl/classes/jogamp/opengl/Debug.java @@ -28,10 +28,10 @@ package jogamp.opengl; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; /** Helper routines for logging and debugging. */ @@ -41,7 +41,7 @@ public class Debug extends PropertyAccess { private static final boolean debugAll; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { PropertyAccess.addTrustedPrefix("jogl."); diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 68c21b84c..6baae35f9 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -42,7 +42,6 @@ package jogamp.opengl; import java.lang.reflect.Method; import java.nio.IntBuffer; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.HashMap; import java.util.IdentityHashMap; @@ -55,6 +54,7 @@ import com.jogamp.common.os.DynamicLookupHelper; import com.jogamp.common.os.Platform; import com.jogamp.common.util.Bitfield; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionNumber; import com.jogamp.common.util.VersionNumberString; import com.jogamp.common.util.locks.RecursiveLock; @@ -1022,7 +1022,8 @@ public abstract class GLContextImpl extends GLContext { this.preCtxVersion = preCtxVersion; this.preCtxOptions = preCtxOptions; } - public final String toString() { + @Override + public final String toString() { return toString(new StringBuilder(), -1, -1, -1, -1).toString(); } public final StringBuilder toString(final StringBuilder sb, final int minMajor, final int minMinor, final int maxMajor, final int maxMinor) { @@ -1621,7 +1622,7 @@ public abstract class GLContextImpl extends GLContext { GLEmitter by looking up anew all of its function pointers using the given {@link GLDynamicLookupHelper}. */ protected final void resetProcAddressTable(final ProcAddressTable table, final GLDynamicLookupHelper dlh) { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { table.reset( dlh ); @@ -1777,7 +1778,7 @@ public abstract class GLContextImpl extends GLContext { final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice(); if( !glGetPtrInit ) { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { final GLDynamicLookupHelper glDynLookupHelper = getGLDynamicLookupHelper(reqMajor, reqCtxProfileBits); @@ -2665,7 +2666,7 @@ public abstract class GLContextImpl extends GLContext { throw new GLException("No GLDynamicLookupHelper for "+this); } final String tmpBase = GLNameResolver.normalizeVEN(GLNameResolver.normalizeARB(glFunctionName, true), true); - return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { boolean res = false; diff --git a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java index fb4529da4..410ad46e8 100644 --- a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java +++ b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java @@ -27,7 +27,6 @@ */ package jogamp.opengl; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; @@ -41,6 +40,7 @@ import jogamp.common.os.PlatformPropsImpl; import com.jogamp.common.ExceptionUtils; import com.jogamp.common.os.Platform; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.gluegen.runtime.ProcAddressTable; import com.jogamp.opengl.GLExtensions; @@ -114,7 +114,7 @@ public class GLDebugMessageHandler { } private final long getAddressFor(final ProcAddressTable table, final String functionName) { - return AccessController.doPrivileged(new PrivilegedAction<Long>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Long>() { @Override public Long run() { try { diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java index 8545f10bf..e65e79b63 100644 --- a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java +++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java @@ -35,7 +35,6 @@ package jogamp.opengl; import java.lang.reflect.InvocationTargetException; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.nativewindow.NativeWindowFactory; @@ -46,6 +45,7 @@ import com.jogamp.opengl.Threading.Mode; import com.jogamp.common.JogampRuntimeException; import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; /** Implementation of the {@link com.jogamp.opengl.Threading} class. */ @@ -63,7 +63,7 @@ public class ThreadingImpl { static { threadingPlugin = - AccessController.doPrivileged(new PrivilegedAction<ToolkitThreadingPlugin>() { + SecurityUtil.doPrivileged(new PrivilegedAction<ToolkitThreadingPlugin>() { @Override public ToolkitThreadingPlugin run() { final String singleThreadProp; diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2D.java b/src/jogl/classes/jogamp/opengl/awt/Java2D.java index 7f6c48ee2..8fb45a3a0 100644 --- a/src/jogl/classes/jogamp/opengl/awt/Java2D.java +++ b/src/jogl/classes/jogamp/opengl/awt/Java2D.java @@ -48,7 +48,6 @@ import java.awt.Rectangle; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.opengl.GL; @@ -58,6 +57,7 @@ import com.jogamp.opengl.GLException; import com.jogamp.opengl.GLProfile; import com.jogamp.common.os.Platform; +import com.jogamp.common.util.SecurityUtil; import jogamp.common.os.PlatformPropsImpl; import jogamp.opengl.Debug; @@ -118,7 +118,7 @@ public class Java2D { private static Method destroyOGLContextMethod; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { if (DEBUG) { diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java index e42cc7af9..f1049ce6e 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java @@ -28,7 +28,6 @@ package jogamp.opengl.util.av.impl; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Arrays; @@ -41,6 +40,7 @@ import com.jogamp.common.ExceptionUtils; import com.jogamp.common.os.DynamicLibraryBundle; import com.jogamp.common.os.DynamicLibraryBundleInfo; import com.jogamp.common.util.RunnableExecutor; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionNumber; /** @@ -217,7 +217,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { throw new InternalError("XXX0 "+symbolNames.length+" != "+symbolCount); } - final DynamicLibraryBundle dl = AccessController.doPrivileged(privInitSymbolsAction); + final DynamicLibraryBundle dl = SecurityUtil.doPrivileged(privInitSymbolsAction); if( null == dl ) { return false; } diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java index 74103fe31..6e44dcc37 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java @@ -30,7 +30,6 @@ package jogamp.opengl.util.av.impl; import java.io.IOException; import java.nio.ByteBuffer; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.opengl.GL; @@ -39,6 +38,7 @@ import com.jogamp.opengl.GLException; import com.jogamp.common.util.IOUtil; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionNumber; import com.jogamp.gluegen.runtime.ProcAddressTable; import com.jogamp.opengl.util.TimeFrameI; @@ -422,7 +422,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { final int audioQueueLimit; if( null != gl && STREAM_ID_NONE != getVID() ) { final GLContextImpl ctx = (GLContextImpl)gl.getContext(); - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { final ProcAddressTable pt = ctx.getGLProcAddressTable(); diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java index 652184e7e..d65027f0d 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java @@ -42,7 +42,6 @@ package jogamp.opengl.windows.wgl; import java.nio.Buffer; import java.nio.ShortBuffer; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.List; @@ -78,6 +77,7 @@ import jogamp.opengl.SharedResourceRunner; import com.jogamp.common.nio.PointerBuffer; import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.nativewindow.GenericUpstreamSurfacelessHook; import com.jogamp.nativewindow.windows.WindowsGraphicsDevice; import com.jogamp.opengl.GLExtensions; @@ -155,7 +155,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { synchronized(WindowsWGLDrawableFactory.class) { if( null == windowsWGLDynamicLookupHelper ) { - windowsWGLDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() { + windowsWGLDynamicLookupHelper = SecurityUtil.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() { @Override public DesktopGLDynamicLookupHelper run() { DesktopGLDynamicLookupHelper tmp; diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java index a03ce1641..85482679b 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java @@ -39,7 +39,6 @@ package jogamp.opengl.x11.glx; import java.nio.Buffer; import java.nio.ShortBuffer; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.List; @@ -72,6 +71,7 @@ import jogamp.opengl.SharedResourceRunner; import com.jogamp.common.ExceptionUtils; import com.jogamp.common.nio.Buffers; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionNumber; import com.jogamp.nativewindow.GenericUpstreamSurfacelessHook; import com.jogamp.nativewindow.x11.X11GraphicsDevice; @@ -96,7 +96,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { synchronized(X11GLXDrawableFactory.class) { if( null == x11GLXDynamicLookupHelper ) { - x11GLXDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() { + x11GLXDynamicLookupHelper = SecurityUtil.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() { @Override public DesktopGLDynamicLookupHelper run() { DesktopGLDynamicLookupHelper tmp; diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java index bedf15c7b..68ab36ed5 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java @@ -35,7 +35,6 @@ package com.jogamp.nativewindow; import java.io.File; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Collections; @@ -61,6 +60,7 @@ import com.jogamp.common.os.Platform; import com.jogamp.common.util.InterruptSource; import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.nativewindow.UpstreamWindowHookMutableSizePos; import com.jogamp.nativewindow.awt.AWTGraphicsDevice; import com.jogamp.nativewindow.awt.AWTGraphicsScreen; @@ -233,7 +233,7 @@ public abstract class NativeWindowFactory { final String[] _tmp = new String[] { null }; final String[] _nativeWindowingTypeNative = new String[] { null }; - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { Platform.initSingleton(); // last resort .. @@ -398,7 +398,7 @@ public abstract class NativeWindowFactory { if( Platform.AWT_AVAILABLE && ReflectionUtil.isClassAvailable("com.jogamp.nativewindow.awt.AWTGraphicsDevice", cl) ) { - final Method[] jawtUtilMethods = AccessController.doPrivileged(new PrivilegedAction<Method[]>() { + final Method[] jawtUtilMethods = SecurityUtil.doPrivileged(new PrivilegedAction<Method[]>() { @Override public Method[] run() { try { diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java index 8189f6262..4fe2d6cd8 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java @@ -2,11 +2,11 @@ package com.jogamp.nativewindow.awt; import java.lang.ref.WeakReference; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.ExceptionUtils; import com.jogamp.common.util.RunnableTask; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.UnsafeUtil; import jogamp.nativewindow.jawt.JAWTUtil; @@ -28,7 +28,7 @@ public class AppContextInfo { static { DEBUG = JAWTUtil.DEBUG; final Method[] _getAppContextMethod = { null }; - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { return UnsafeUtil.doWithoutIllegalAccessLogger(new PrivilegedAction<Object>() { diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java b/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java index 9d38b1f4b..61358c56a 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java @@ -28,7 +28,6 @@ package com.jogamp.nativewindow.javafx; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.nativewindow.AbstractGraphicsDevice; @@ -43,6 +42,7 @@ import com.jogamp.common.ExceptionUtils; import com.jogamp.common.util.InterruptedRuntimeException; import com.jogamp.common.util.ReflectionUtil; import com.jogamp.common.util.RunnableTask; +import com.jogamp.common.util.SecurityUtil; import com.sun.javafx.tk.TKStage; import javafx.application.Platform; @@ -69,7 +69,7 @@ public class JFXAccessor { static { final boolean[] _DEBUG = new boolean[] { true }; - final Method[] res = AccessController.doPrivileged(new PrivilegedAction<Method[]>() { + final Method[] res = SecurityUtil.doPrivileged(new PrivilegedAction<Method[]>() { @Override public Method[] run() { NativeWindowFactory.initSingleton(); // last resort .. @@ -270,6 +270,7 @@ public class JFXAccessor { public static long getWindowHandle(final Window stageWindow) throws NativeWindowException { final long h[] = { 0 }; runOnJFXThread(true, new Runnable() { + @Override public void run() { try { final TKStage tkStage = (TKStage) tkStageGetter.invoke(stageWindow); diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java index 7f4a94c5b..1ddf14b82 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java @@ -32,7 +32,6 @@ import com.jogamp.common.os.Platform; import java.io.PrintStream; import java.lang.reflect.Field; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import org.eclipse.swt.SWT; @@ -50,6 +49,7 @@ import com.jogamp.nativewindow.AbstractGraphicsDevice; import com.jogamp.nativewindow.NativeWindowFactory; import com.jogamp.nativewindow.VisualIDHolder; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionNumber; import com.jogamp.nativewindow.macosx.MacOSXGraphicsDevice; import com.jogamp.nativewindow.windows.WindowsGraphicsDevice; @@ -138,7 +138,7 @@ public class SWTAccessor { } static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { NativeWindowFactory.initSingleton(); // last resort .. diff --git a/src/nativewindow/classes/jogamp/nativewindow/BcmVCArtifacts.java b/src/nativewindow/classes/jogamp/nativewindow/BcmVCArtifacts.java index 0fc0665bc..a6be62e4e 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/BcmVCArtifacts.java +++ b/src/nativewindow/classes/jogamp/nativewindow/BcmVCArtifacts.java @@ -29,9 +29,10 @@ package jogamp.nativewindow; import java.io.File; -import java.security.AccessController; import java.security.PrivilegedAction; +import com.jogamp.common.util.SecurityUtil; + /** * Heuristics about Broadcom (BCM) VideoCore (VC) existence and usage */ @@ -48,7 +49,7 @@ public class BcmVCArtifacts { final File driCard0Location = new File( "/dev/dri/card0"); final boolean[] res = new boolean [3]; - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { res[0] = vcLibLocation.isFile(); diff --git a/src/nativewindow/classes/jogamp/nativewindow/Debug.java b/src/nativewindow/classes/jogamp/nativewindow/Debug.java index 8d8fd0667..9ccb5b3a5 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/Debug.java +++ b/src/nativewindow/classes/jogamp/nativewindow/Debug.java @@ -28,10 +28,10 @@ package jogamp.nativewindow; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; /** Helper routines for logging and debugging. */ @@ -41,7 +41,7 @@ public class Debug extends PropertyAccess { private static final boolean debugAll; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { PropertyAccess.addTrustedPrefix("nativewindow."); diff --git a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java index 1284974bf..7d530dda6 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java +++ b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java @@ -29,16 +29,16 @@ package jogamp.nativewindow; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.jvm.JNILibLoaderBase; import com.jogamp.common.os.Platform; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.cache.TempJarCache; public class NWJNILibLoader extends JNILibLoaderBase { public static boolean loadNativeWindow(final String ossuffix) { - return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { Platform.initSingleton(); diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java index fe83ebc76..04585e4ca 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java @@ -39,17 +39,17 @@ package jogamp.nativewindow.jawt; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.nativewindow.NativeWindowFactory; import jogamp.nativewindow.NWJNILibLoader; import java.awt.Toolkit; -import java.security.AccessController; import java.security.PrivilegedAction; public class JAWTJNILibLoader extends NWJNILibLoader { static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { // Make sure that awt.dll is loaded before loading jawt.dll. Otherwise diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java index f4e55cd47..bb18910fc 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java @@ -45,7 +45,6 @@ import java.awt.Toolkit; import java.awt.geom.AffineTransform; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Map; @@ -67,6 +66,7 @@ import jogamp.nativewindow.x11.X11Lib; import com.jogamp.common.ExceptionUtils; import com.jogamp.common.os.Platform; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.UnsafeUtil; import com.jogamp.common.util.VersionNumber; import com.jogamp.common.util.locks.LockFactory; @@ -362,7 +362,7 @@ public class JAWTUtil { // Always enforce using sun.awt.SunToolkit's awtLock even on JVM >= Java_9, // as we have no other official means to synchronize native UI locks especially for X11 { - final SunToolkitData std = AccessController.doPrivileged(new PrivilegedAction<SunToolkitData>() { + final SunToolkitData std = SecurityUtil.doPrivileged(new PrivilegedAction<SunToolkitData>() { @Override public SunToolkitData run() { return UnsafeUtil.doWithoutIllegalAccessLogger(new PrivilegedAction<SunToolkitData>() { @@ -407,7 +407,7 @@ public class JAWTUtil { gdGetScaleFactorMID = null; gdGetCGDisplayIDMIDOnOSX = null; } else { - final GraphicsDeviceData gdd = (GraphicsDeviceData) AccessController.doPrivileged(new PrivilegedAction<Object>() { + final GraphicsDeviceData gdd = (GraphicsDeviceData) SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { final GraphicsDeviceData d = new GraphicsDeviceData(); diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java index f67cc7189..4e89709f2 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java @@ -43,7 +43,6 @@ package jogamp.nativewindow.jawt.macosx; import java.awt.Component; import java.awt.GraphicsConfiguration; import java.nio.Buffer; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.nativewindow.AbstractGraphicsConfiguration; @@ -54,6 +53,7 @@ import com.jogamp.nativewindow.MutableSurface; import com.jogamp.nativewindow.util.Point; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.nativewindow.awt.JAWTWindow; import jogamp.nativewindow.Debug; @@ -272,7 +272,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface { ret = NativeSurface.LOCK_SURFACE_CHANGED; } if (firstLock) { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { dsi = ds.GetDrawingSurfaceInfo(); diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java index 55aaf90d2..54f34375d 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java @@ -44,10 +44,10 @@ import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.ExceptionUtils; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.UnsafeUtil; import com.jogamp.nativewindow.AbstractGraphicsConfiguration; @@ -68,7 +68,7 @@ public class Win32SunJDKReflection { private static boolean initialized; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { return UnsafeUtil.doWithoutIllegalAccessLogger(new PrivilegedAction<Object>() { diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java index d86704c07..497d901f5 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java @@ -44,10 +44,10 @@ import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.ExceptionUtils; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.UnsafeUtil; import com.jogamp.nativewindow.AbstractGraphicsConfiguration; @@ -67,7 +67,7 @@ public class X11SunJDKReflection { private static boolean initialized; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { return UnsafeUtil.doWithoutIllegalAccessLogger(new PrivilegedAction<Object>() { diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java index e06a68953..10a3a602f 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java @@ -32,7 +32,6 @@ import com.jogamp.nativewindow.NativeWindowFactory; import com.jogamp.nativewindow.util.Insets; import com.jogamp.nativewindow.util.Point; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.ExceptionUtils; @@ -41,6 +40,7 @@ import com.jogamp.common.util.Function; import com.jogamp.common.util.FunctionTask; import com.jogamp.common.util.InterruptedRuntimeException; import com.jogamp.common.util.RunnableTask; +import com.jogamp.common.util.SecurityUtil; import jogamp.nativewindow.Debug; import jogamp.nativewindow.NWJNILibLoader; @@ -70,7 +70,7 @@ public class OSXUtil implements ToolkitProperties { } if( useMainThreadChecker ) { final String libMainThreadChecker = "/Applications/Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib"; - final NativeLibrary lib = AccessController.doPrivileged(new PrivilegedAction<NativeLibrary>() { + final NativeLibrary lib = SecurityUtil.doPrivileged(new PrivilegedAction<NativeLibrary>() { @Override public NativeLibrary run() { return NativeLibrary.open(libMainThreadChecker, false, false, OSXUtil.class.getClassLoader(), true); diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java index 99ce16136..61d21026a 100644 --- a/src/newt/classes/com/jogamp/newt/NewtFactory.java +++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java @@ -34,7 +34,6 @@ package com.jogamp.newt; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Arrays; @@ -48,6 +47,7 @@ import com.jogamp.nativewindow.NativeWindowFactory; import com.jogamp.common.util.IOUtil; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; import jogamp.newt.Debug; import jogamp.newt.DisplayImpl; @@ -63,7 +63,7 @@ public class NewtFactory { private static String sysPaths = "newt/data/jogamp-16x16.png newt/data/jogamp-32x32.png"; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { NativeWindowFactory.initSingleton(); // last resort .. diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index f6c7ad955..c7e1c0a45 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -34,7 +34,6 @@ package com.jogamp.newt.opengl; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.List; @@ -74,6 +73,7 @@ import jogamp.opengl.GLContextImpl; import jogamp.opengl.GLDrawableImpl; import com.jogamp.common.GlueGenVersion; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionUtil; import com.jogamp.common.util.locks.RecursiveLock; import com.jogamp.newt.MonitorDevice; @@ -739,7 +739,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind if( animThread == Thread.currentThread() ) { anim.stop(); // on anim thread, non-blocking } else { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { if( anim.isAnimating() && null != animThread ) { diff --git a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java index c30576ff4..055e38020 100644 --- a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java +++ b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java @@ -28,7 +28,6 @@ package com.jogamp.newt.util.applet; import java.lang.reflect.Field; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.nativewindow.NativeWindow; @@ -43,6 +42,7 @@ import com.jogamp.opengl.GLPipelineFactory; import jogamp.newt.Debug; import com.jogamp.common.util.InterruptSource; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.newt.Window; import com.jogamp.newt.event.KeyEvent; import com.jogamp.newt.event.KeyListener; @@ -119,7 +119,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener { Object instance = null; try { - final Class<?> clazz = AccessController.doPrivileged(new PrivilegedAction<Class<?>>() { + final Class<?> clazz = SecurityUtil.doPrivileged(new PrivilegedAction<Class<?>>() { @Override public Class<?> run() { final ClassLoader cl = Thread.currentThread().getContextClassLoader(); @@ -312,7 +312,8 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener { if(e.getKeyChar()=='r' && 0==e.getModifiers() && null!=parentWin) { e.setConsumed(true); glWindow.invokeOnNewThread(null, false, new Runnable() { - public void run() { + @Override + public void run() { if(null == glWindow.getParent()) { glWindow.reparentWindow(parentWin, -1, -1, 0 /* hints */); } else { diff --git a/src/newt/classes/jogamp/newt/Debug.java b/src/newt/classes/jogamp/newt/Debug.java index a255cb755..60b259214 100644 --- a/src/newt/classes/jogamp/newt/Debug.java +++ b/src/newt/classes/jogamp/newt/Debug.java @@ -28,10 +28,10 @@ package jogamp.newt; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; /** Helper routines for logging and debugging. */ @@ -41,7 +41,7 @@ public class Debug extends PropertyAccess { private static final boolean debugAll; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { PropertyAccess.addTrustedPrefix("newt."); diff --git a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java index fde3de222..e2bf86002 100644 --- a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java +++ b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java @@ -39,11 +39,11 @@ package jogamp.newt; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.jvm.JNILibLoaderBase; import com.jogamp.common.os.Platform; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.cache.TempJarCache; public class NEWTJNILibLoader extends JNILibLoaderBase { @@ -52,7 +52,7 @@ public class NEWTJNILibLoader extends JNILibLoaderBase { * i.e. X11 for Unix, GDI for Windows .. and so forth. */ public static boolean loadNEWTHead() { - return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { Platform.initSingleton(); @@ -68,7 +68,7 @@ public class NEWTJNILibLoader extends JNILibLoaderBase { * Loads the NEWT native library for the drm/gbm display. */ public static boolean loadNEWTDrmGbm() { - return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { Platform.initSingleton(); diff --git a/src/oculusvr/classes/com/jogamp/oculusvr/OVRDynamicLibraryBundleInfo.java b/src/oculusvr/classes/com/jogamp/oculusvr/OVRDynamicLibraryBundleInfo.java index 4b5145ded..6e25c83bb 100644 --- a/src/oculusvr/classes/com/jogamp/oculusvr/OVRDynamicLibraryBundleInfo.java +++ b/src/oculusvr/classes/com/jogamp/oculusvr/OVRDynamicLibraryBundleInfo.java @@ -34,15 +34,15 @@ import com.jogamp.common.os.DynamicLibraryBundleInfo; import com.jogamp.common.os.Platform; import com.jogamp.common.util.RunnableExecutor; import com.jogamp.common.util.cache.TempJarCache; +import com.jogamp.common.util.SecurityUtil; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.*; /* pp */ final class OVRDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { private static final List<String> glueLibNames; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { public Object run() { Platform.initSingleton(); |