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
|
@ -39,6 +39,8 @@ import java.lang.reflect.AccessFlag;
|
|||
import java.lang.reflect.AnnotatedElement;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.security.CodeSource;
|
||||
import java.security.ProtectionDomain;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -294,9 +296,12 @@ public final class Module implements AnnotatedElement {
|
|||
String mod = isNamed() ? "module " + getName() : "an unnamed module";
|
||||
if (currentClass != null) {
|
||||
// try to extract location of the current class (e.g. jar or folder)
|
||||
URL url = System.codeSource(currentClass);
|
||||
if (url != null) {
|
||||
mod += " (" + url + ")";
|
||||
CodeSource cs = currentClass.getProtectionDomain().getCodeSource();
|
||||
if (cs != null) {
|
||||
URL url = cs.getLocation();
|
||||
if (url != null) {
|
||||
mod += " (" + url + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (illegalNativeAccess == ModuleBootstrap.IllegalNativeAccess.DENY) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue