mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8241770: Module xxxAnnotation() methods throw NCDFE if module-info.class found as resource in unnamed module
Reviewed-by: mchung
This commit is contained in:
parent
96fadefaa3
commit
c563c3d15b
3 changed files with 110 additions and 48 deletions
|
@ -42,7 +42,6 @@ import java.security.AccessController;
|
|||
import java.security.PrivilegedAction;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
@ -1504,6 +1503,24 @@ public final class Module implements AnnotatedElement {
|
|||
throw new ClassNotFoundException(cn);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected Class<?> loadClass(String cn, boolean resolve)
|
||||
throws ClassNotFoundException
|
||||
{
|
||||
synchronized (getClassLoadingLock(cn)) {
|
||||
Class<?> c = findLoadedClass(cn);
|
||||
if (c == null) {
|
||||
if (cn.equals(MODULE_INFO)) {
|
||||
c = findClass(cn);
|
||||
} else {
|
||||
c = super.loadClass(cn, resolve);
|
||||
}
|
||||
}
|
||||
if (resolve)
|
||||
resolveClass(c);
|
||||
return c;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue