Skip to content

Commit

Permalink
manual change before automatic annotating
Browse files Browse the repository at this point in the history
  • Loading branch information
wangweij committed May 17, 2021
1 parent 576161d commit 26a54a8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/java.base/share/classes/java/lang/ProcessHandleImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package java.lang;

import java.lang.annotation.Native;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.time.Duration;
import java.time.Instant;
Expand All @@ -40,8 +41,6 @@
import java.util.stream.IntStream;
import java.util.stream.Stream;

import static java.security.AccessController.doPrivileged;

/**
* ProcessHandleImpl is the implementation of ProcessHandle.
*
Expand Down Expand Up @@ -84,7 +83,7 @@ final class ProcessHandleImpl implements ProcessHandle {
* The thread pool of "process reaper" daemon threads.
*/
private static final Executor processReaperExecutor =
doPrivileged((PrivilegedAction<Executor>) () -> {
AccessController.doPrivileged((PrivilegedAction<Executor>) () -> {
// Initialize ThreadLocalRandom now to avoid using the smaller stack
// of the processReaper threads.
ThreadLocalRandom.current();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import sun.security.util.Debug;
* @since 1.4
*/

@SuppressWarnings("removal")
final class JceSecurity {

private static final Debug debug = Debug.getInstance("jca");
Expand Down
3 changes: 1 addition & 2 deletions src/java.base/unix/classes/java/lang/ProcessImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.security.AccessController;
import static java.security.AccessController.doPrivileged;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
Expand Down Expand Up @@ -321,7 +320,7 @@ private ProcessImpl(final byte[] prog,
processHandle = ProcessHandleImpl.getInternal(pid);

try {
doPrivileged((PrivilegedExceptionAction<Void>) () -> {
AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
initStreams(fds, forceNullOutputStream);
return null;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import java.awt.*;
import java.beans.*;
import java.security.AccessController;

import javax.swing.*;
import javax.swing.border.Border;
Expand All @@ -39,8 +40,6 @@
import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
import sun.security.action.GetPropertyAction;

import static java.security.AccessController.*;

public class AquaUtilControlSize {
protected static final String CLIENT_PROPERTY_KEY = "JComponent.sizeVariant";
protected static final String SYSTEM_PROPERTY_KEY = "swing.component.sizevariant";
Expand Down Expand Up @@ -73,7 +72,7 @@ private static JRSUIConstants.Size getSizeFromString(final String name) {
}

private static Size getDefaultSize() {
final String sizeProperty = doPrivileged(new GetPropertyAction(SYSTEM_PROPERTY_KEY));
final String sizeProperty = AccessController.doPrivileged(new GetPropertyAction(SYSTEM_PROPERTY_KEY));

This comment has been minimized.

Copy link
@prrace

prrace May 18, 2021

Contributor

Since this is a manual change can you make sure to wrap at 80 chars.

This comment has been minimized.

Copy link
@wangweij

wangweij May 18, 2021

Author Contributor

Done. Thanks.

final JRSUIConstants.Size size = getSizeFromString(sizeProperty);
if (size != null) return size;
return JRSUIConstants.Size.REGULAR;
Expand Down
1 change: 1 addition & 0 deletions test/lib/jdk/test/lib/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class Platform {
private static final String compiler = privilegedGetProperty("sun.management.compiler");
private static final String testJdk = privilegedGetProperty("test.jdk");

@SuppressWarnings("removal")
private static String privilegedGetProperty(String key) {
return AccessController.doPrivileged((
PrivilegedAction<String>) () -> System.getProperty(key));
Expand Down
1 change: 1 addition & 0 deletions test/lib/sun/hotspot/WhiteBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ private WhiteBox() {}
* untrusted code.
*/
public synchronized static WhiteBox getWhiteBox() {
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new WhiteBoxPermission("getInstance"));
Expand Down

0 comments on commit 26a54a8

Please sign in to comment.