aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-01-14 21:31:45 +0100
committerSven Gothel <[email protected]>2023-01-14 21:31:45 +0100
commit72a8be591d5daba1e4e231c386812c543d503fce (patch)
treeb4a08e451741eab5a9cad4617e2151bdfd8f5223 /src/newt
parent4dfe7369d8e58978dc56235344731f927a1c8ae4 (diff)
Replace AccessController.doPrivileged() w/ SecurityUtil.doPrivileged()
Diffstat (limited to 'src/newt')
-rw-r--r--src/newt/classes/com/jogamp/newt/NewtFactory.java4
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java4
-rw-r--r--src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java7
-rw-r--r--src/newt/classes/jogamp/newt/Debug.java4
-rw-r--r--src/newt/classes/jogamp/newt/NEWTJNILibLoader.java6
5 files changed, 13 insertions, 12 deletions
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();