mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8344336: SM cleanup of java.lang.System, Runtime, String, StackWalker
Reviewed-by: dfuchs, alanb, lancea
This commit is contained in:
parent
0f458e2c3e
commit
c199f5326b
6 changed files with 14 additions and 219 deletions
|
@ -379,7 +379,6 @@ public final class StackWalker {
|
|||
}
|
||||
|
||||
EnumSet<Option> optionSet = toEnumSet(options);
|
||||
checkPermission(optionSet);
|
||||
return new StackWalker(optionSet);
|
||||
}
|
||||
|
||||
|
@ -409,7 +408,6 @@ public final class StackWalker {
|
|||
throw new IllegalArgumentException("estimateDepth must be > 0");
|
||||
}
|
||||
EnumSet<Option> optionSet = toEnumSet(options);
|
||||
checkPermission(optionSet);
|
||||
return new StackWalker(optionSet, estimateDepth);
|
||||
}
|
||||
|
||||
|
@ -433,17 +431,6 @@ public final class StackWalker {
|
|||
this.continuation = continuation;
|
||||
}
|
||||
|
||||
private static void checkPermission(Set<Option> options) {
|
||||
Objects.requireNonNull(options);
|
||||
@SuppressWarnings("removal")
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null) {
|
||||
if (options.contains(Option.RETAIN_CLASS_REFERENCE)) {
|
||||
sm.checkPermission(new RuntimePermission("getStackWalkerWithClassReference"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns a defensive copy
|
||||
*/
|
||||
|
@ -637,7 +624,6 @@ public final class StackWalker {
|
|||
|
||||
static StackWalker newInstance(Set<Option> options, ExtendedOption extendedOption, ContinuationScope contScope, Continuation continuation) {
|
||||
EnumSet<Option> optionSet = toEnumSet(options);
|
||||
checkPermission(optionSet);
|
||||
return new StackWalker(optionSet, 0, extendedOption, contScope, continuation);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue