Skip to content

Commit 8d43e0d

Browse files
author
Justin Lu
committed
8344331: SM cleanup in java.scripting
Reviewed-by: naoto, lancea
1 parent f636674 commit 8d43e0d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/java.scripting/share/classes/javax/script/ScriptEngineManager.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
2525

2626
package javax.script;
2727
import java.util.*;
28-
import java.security.*;
2928
import java.util.ServiceLoader;
3029
import java.util.ServiceConfigurationError;
3130
import java.util.function.Function;
@@ -87,10 +86,7 @@ private ServiceLoader<ScriptEngineFactory> getServiceLoader(final ClassLoader lo
8786
private void initEngines(final ClassLoader loader) {
8887
Iterator<ScriptEngineFactory> itr;
8988
try {
90-
@SuppressWarnings("removal")
91-
var sl = AccessController.doPrivileged(
92-
(PrivilegedAction<ServiceLoader<ScriptEngineFactory>>)() -> getServiceLoader(loader));
93-
itr = sl.iterator();
89+
itr = getServiceLoader(loader).iterator();
9490
} catch (ServiceConfigurationError err) {
9591
reportException("Can't find ScriptEngineFactory providers: ", err);
9692
// do not throw any exception here. user may want to

0 commit comments

Comments
 (0)