Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions modules/javafx.base/src/main/java/com/sun/javafx/PlatformUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,28 @@ public class PlatformUtil {
private static String javafxPlatform;

static {
javafxPlatform = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty("javafx.platform"));
@SuppressWarnings("removal")
String str1 = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty("javafx.platform"));
javafxPlatform = str1;

loadProperties();
embedded = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> Boolean.getBoolean("com.sun.javafx.isEmbedded"));
embeddedType = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty("embedded"));
useEGL = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> Boolean.getBoolean("use.egl"));

@SuppressWarnings("removal")
boolean bool1 = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> Boolean.getBoolean("com.sun.javafx.isEmbedded"));
embedded = bool1;

@SuppressWarnings("removal")
String str2 = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty("embedded"));
embeddedType = str2;

@SuppressWarnings("removal")
boolean bool2 = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> Boolean.getBoolean("use.egl"));
useEGL = bool2;

if (useEGL) {
doEGLCompositing = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> Boolean.getBoolean("doNativeComposite"));
@SuppressWarnings("removal")
boolean bool3 = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> Boolean.getBoolean("doNativeComposite"));
doEGLCompositing = bool3;
} else
doEGLCompositing = false;
}
Expand Down Expand Up @@ -134,8 +149,8 @@ public static boolean useEGLWindowComposition() {
}

public static boolean useGLES2() {
String useGles2 = "false";
useGles2 =
@SuppressWarnings("removal")
String useGles2 =
AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty("use.gles2"));
if ("true".equals(useGles2))
return true;
Expand Down Expand Up @@ -244,6 +259,7 @@ private static File getRTDir() {
}
}

@SuppressWarnings("removal")
private static void loadProperties() {
final String vmname = System.getProperty("java.vm.name");
final String arch = System.getProperty("os.arch");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ class PrintLogger extends Logger {
* the threshold, then it is logged, otherwise an abbreviated representation including
* only the time of the pulse is logged.
*/
@SuppressWarnings("removal")
private static long THRESHOLD = (long)
AccessController.doPrivileged((PrivilegedAction<Integer>) () -> Integer.getInteger("javafx.pulseLogger.threshold", 17));

/**
* Optionally exit after a given number of pulses
*/
@SuppressWarnings("removal")
private static final int EXIT_ON_PULSE =
AccessController.doPrivileged((PrivilegedAction<Integer>) () -> Integer.getInteger("javafx.pulseLogger.exitOnPulse", 0));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public static void newInput(String name) {
* @return true if the user requested pulse logging by setting the system
* property javafx.pulseLogger to true, false otherwise.
*/
@SuppressWarnings("removal")
public static boolean isPulseLoggingRequested() {
return AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> Boolean.getBoolean("javafx.pulseLogger"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* Utility class to wrap method invocation.
*/
public class MethodHelper {
@SuppressWarnings("removal")
private static final boolean logAccessErrors
= AccessController.doPrivileged((PrivilegedAction<Boolean>) ()
-> Boolean.getBoolean("sun.reflect.debugModuleAccessChecks"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@

package com.sun.javafx.property;

import static java.security.AccessController.doPrivileged;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.security.PrivilegedAction;

import javafx.beans.property.ReadOnlyProperty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public class Disposer implements Runnable {
static {
disposerInstance = new Disposer();

java.security.AccessController.doPrivileged(
@SuppressWarnings("removal")
var dummy = java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
public Object run() {
/* The thread must be a member of a thread group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class Trampoline {
}
}

@SuppressWarnings("removal")
private static void ensureInvocableMethod(Method m)
throws InvocationTargetException
{
Expand Down Expand Up @@ -107,6 +108,7 @@ public static Method[] getMethods(Class<?> cls) {
* we're done.
*/
/*public*/
@SuppressWarnings("removal")
static Method[] getPublicMethods(Class<?> cls) {
// compatibility for update release
if (System.getSecurityManager() == null) {
Expand Down Expand Up @@ -291,6 +293,7 @@ public static Object invoke(Method m, Object obj, Object[] params)
}
}

@SuppressWarnings("removal")
private static Method getTrampoline() {
try {
return AccessController.doPrivileged(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private ReflectUtil() {
* also check the package access on the proxy interfaces.
*/
public static void checkPackageAccess(Class<?> clazz) {
@SuppressWarnings("removal")
SecurityManager s = System.getSecurityManager();
if (s != null) {
privateCheckPackageAccess(s, clazz);
Expand All @@ -50,7 +51,7 @@ public static void checkPackageAccess(Class<?> clazz) {
/**
* NOTE: should only be called if a SecurityManager is installed
*/
private static void privateCheckPackageAccess(SecurityManager s, Class<?> clazz) {
private static void privateCheckPackageAccess(@SuppressWarnings("removal") SecurityManager s, Class<?> clazz) {
while (clazz.isArray()) {
clazz = clazz.getComponentType();
}
Expand All @@ -72,6 +73,7 @@ private static void privateCheckPackageAccess(SecurityManager s, Class<?> clazz)
* the true caller (application).
*/
public static void checkPackageAccess(String name) {
@SuppressWarnings("removal")
SecurityManager s = System.getSecurityManager();
if (s != null) {
String cname = name.replace('/', '.');
Expand Down Expand Up @@ -100,7 +102,7 @@ public static boolean isPackageAccessible(Class<?> clazz) {
/**
* NOTE: should only be called if a SecurityManager is installed
*/
private static void privateCheckProxyPackageAccess(SecurityManager s, Class<?> clazz) {
private static void privateCheckProxyPackageAccess(@SuppressWarnings("removal") SecurityManager s, Class<?> clazz) {
// check proxy interfaces if the given class is a proxy class
if (Proxy.isProxyClass(clazz)) {
for (Class<?> intf : clazz.getInterfaces()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public final class JavaBeanBooleanProperty extends BooleanProperty implements Ja
private ObservableValue<? extends Boolean> observable = null;
private ExpressionHelper<Boolean> helper = null;

@SuppressWarnings("removal")
private final AccessControlContext acc = AccessController.getContext();

JavaBeanBooleanProperty(PropertyDescriptor descriptor, Object bean) {
Expand All @@ -112,6 +113,7 @@ public final class JavaBeanBooleanProperty extends BooleanProperty implements Ja
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public boolean get() {
return AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> {
Expand All @@ -132,6 +134,7 @@ public boolean get() {
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public void set(final boolean value) {
if (isBound()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public final class JavaBeanDoubleProperty extends DoubleProperty implements Java
private ObservableValue<? extends Number> observable = null;
private ExpressionHelper<Number> helper = null;

@SuppressWarnings("removal")
private final AccessControlContext acc = AccessController.getContext();

JavaBeanDoubleProperty(PropertyDescriptor descriptor, Object bean) {
Expand All @@ -112,6 +113,7 @@ public final class JavaBeanDoubleProperty extends DoubleProperty implements Java
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public double get() {
return AccessController.doPrivileged((PrivilegedAction<Double>) () -> {
Expand All @@ -133,6 +135,7 @@ public double get() {
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public void set(final double value) {
if (isBound()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public final class JavaBeanFloatProperty extends FloatProperty implements JavaBe
private ObservableValue<? extends Number> observable = null;
private ExpressionHelper<Number> helper = null;

@SuppressWarnings("removal")
private final AccessControlContext acc = AccessController.getContext();

JavaBeanFloatProperty(PropertyDescriptor descriptor, Object bean) {
Expand All @@ -112,6 +113,7 @@ public final class JavaBeanFloatProperty extends FloatProperty implements JavaBe
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public float get() {
return AccessController.doPrivileged((PrivilegedAction<Float>) () -> {
Expand All @@ -133,6 +135,7 @@ public float get() {
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public void set(final float value) {
if (isBound()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public final class JavaBeanIntegerProperty extends IntegerProperty implements Ja
private ObservableValue<? extends Number> observable = null;
private ExpressionHelper<Number> helper = null;

@SuppressWarnings("removal")
private final AccessControlContext acc = AccessController.getContext();

JavaBeanIntegerProperty(PropertyDescriptor descriptor, Object bean) {
Expand All @@ -112,6 +113,7 @@ public final class JavaBeanIntegerProperty extends IntegerProperty implements Ja
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public int get() {
return AccessController.doPrivileged((PrivilegedAction<Integer>) () -> {
Expand All @@ -133,6 +135,7 @@ public int get() {
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public void set(final int value) {
if (isBound()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public final class JavaBeanLongProperty extends LongProperty implements JavaBean
private ObservableValue<? extends Number> observable = null;
private ExpressionHelper<Number> helper = null;

@SuppressWarnings("removal")
private final AccessControlContext acc = AccessController.getContext();

JavaBeanLongProperty(PropertyDescriptor descriptor, Object bean) {
Expand All @@ -112,6 +113,7 @@ public final class JavaBeanLongProperty extends LongProperty implements JavaBean
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public long get() {
return AccessController.doPrivileged((PrivilegedAction<Long>) () -> {
Expand All @@ -133,6 +135,7 @@ public long get() {
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public void set(final long value) {
if (isBound()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public final class JavaBeanObjectProperty<T> extends ObjectProperty<T> implement
private ObservableValue<? extends T> observable = null;
private ExpressionHelper<T> helper = null;

@SuppressWarnings("removal")
private final AccessControlContext acc = AccessController.getContext();

JavaBeanObjectProperty(PropertyDescriptor descriptor, Object bean) {
Expand All @@ -114,7 +115,7 @@ public final class JavaBeanObjectProperty<T> extends ObjectProperty<T> implement
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({"removal","unchecked"})
@Override
public T get() {
return AccessController.doPrivileged((PrivilegedAction<T>) () -> {
Expand All @@ -135,6 +136,7 @@ public T get() {
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public void set(final T value) {
if (isBound()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public final class JavaBeanStringProperty extends StringProperty implements Java
private ObservableValue<? extends String> observable = null;
private ExpressionHelper<String> helper = null;

@SuppressWarnings("removal")
private final AccessControlContext acc = AccessController.getContext();

JavaBeanStringProperty(PropertyDescriptor descriptor, Object bean) {
Expand All @@ -112,6 +113,7 @@ public final class JavaBeanStringProperty extends StringProperty implements Java
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public String get() {
return AccessController.doPrivileged((PrivilegedAction<String>) () -> {
Expand All @@ -132,6 +134,7 @@ public String get() {
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public void set(final String value) {
if (isBound()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public final class ReadOnlyJavaBeanBooleanProperty extends ReadOnlyBooleanProper
private final ReadOnlyPropertyDescriptor descriptor;
private final ReadOnlyPropertyDescriptor.ReadOnlyListener<Boolean> listener;

@SuppressWarnings("removal")
private final AccessControlContext acc = AccessController.getContext();

ReadOnlyJavaBeanBooleanProperty(ReadOnlyPropertyDescriptor descriptor, Object bean) {
Expand All @@ -101,6 +102,7 @@ public final class ReadOnlyJavaBeanBooleanProperty extends ReadOnlyBooleanProper
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public boolean get() {
return AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public final class ReadOnlyJavaBeanDoubleProperty extends ReadOnlyDoubleProperty
private final ReadOnlyPropertyDescriptor descriptor;
private final ReadOnlyPropertyDescriptor.ReadOnlyListener<Number> listener;

@SuppressWarnings("removal")
private final AccessControlContext acc = AccessController.getContext();

ReadOnlyJavaBeanDoubleProperty(ReadOnlyPropertyDescriptor descriptor, Object bean) {
Expand All @@ -101,6 +102,7 @@ public final class ReadOnlyJavaBeanDoubleProperty extends ReadOnlyDoubleProperty
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public double get() {
return AccessController.doPrivileged((PrivilegedAction<Double>) () -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public final class ReadOnlyJavaBeanFloatProperty extends ReadOnlyFloatPropertyBa
private final ReadOnlyPropertyDescriptor descriptor;
private final ReadOnlyPropertyDescriptor.ReadOnlyListener<Number> listener;

@SuppressWarnings("removal")
private final AccessControlContext acc = AccessController.getContext();

ReadOnlyJavaBeanFloatProperty(ReadOnlyPropertyDescriptor descriptor, Object bean) {
Expand All @@ -101,6 +102,7 @@ public final class ReadOnlyJavaBeanFloatProperty extends ReadOnlyFloatPropertyBa
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public float get() {
return AccessController.doPrivileged((PrivilegedAction<Float>) () -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public final class ReadOnlyJavaBeanIntegerProperty extends ReadOnlyIntegerProper
private final ReadOnlyPropertyDescriptor descriptor;
private final ReadOnlyPropertyDescriptor.ReadOnlyListener<Number> listener;

@SuppressWarnings("removal")
private final AccessControlContext acc = AccessController.getContext();

ReadOnlyJavaBeanIntegerProperty(ReadOnlyPropertyDescriptor descriptor, Object bean) {
Expand All @@ -101,6 +102,7 @@ public final class ReadOnlyJavaBeanIntegerProperty extends ReadOnlyIntegerProper
* property throws an {@code IllegalAccessException} or an
* {@code InvocationTargetException}.
*/
@SuppressWarnings("removal")
@Override
public int get() {
return AccessController.doPrivileged((PrivilegedAction<Integer>) () -> {
Expand Down
Loading