mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-04 02:35:33 +00:00
8154578: Drop residual use of addReads from javadoc
Reviewed-by: alanb, jjg
This commit is contained in:
parent
c7ff526996
commit
5950e361a2
@ -242,7 +242,6 @@ public class TagletManager {
|
||||
}
|
||||
|
||||
customTagClass = tagClassLoader.loadClass(classname);
|
||||
ensureReadable(customTagClass);
|
||||
|
||||
Method meth = customTagClass.getMethod("register",
|
||||
Map.class);
|
||||
@ -269,27 +268,6 @@ public class TagletManager {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the module of the given class is readable to this
|
||||
* module.
|
||||
* @param targetClass class in module to be made readable
|
||||
*/
|
||||
private void ensureReadable(Class<?> targetClass) {
|
||||
try {
|
||||
Method getModuleMethod = Class.class.getMethod("getModule");
|
||||
Object thisModule = getModuleMethod.invoke(this.getClass());
|
||||
Object targetModule = getModuleMethod.invoke(targetClass);
|
||||
|
||||
Class<?> moduleClass = getModuleMethod.getReturnType();
|
||||
Method addReadsMethod = moduleClass.getMethod("addReads", moduleClass);
|
||||
addReadsMethod.invoke(thisModule, targetModule);
|
||||
} catch (NoSuchMethodException e) {
|
||||
// ignore
|
||||
} catch (Exception e) {
|
||||
throw new InternalError(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export javadoc internal API to the unnamed module for a classloader.
|
||||
* This is to support continued use of existing non-standard doclets that
|
||||
|
||||
@ -102,7 +102,6 @@ public class DocletInvoker {
|
||||
this.apiMode = apiMode;
|
||||
this.exportInternalAPI = exportInternalAPI; // for backdoor use by standard doclet for taglets
|
||||
|
||||
ensureReadable(docletClass);
|
||||
// this may not be soon enough if the class has already been loaded
|
||||
if (exportInternalAPI) {
|
||||
exportInternalAPI(docletClass.getClassLoader());
|
||||
@ -149,8 +148,6 @@ public class DocletInvoker {
|
||||
messager.exit();
|
||||
}
|
||||
docletClass = dc;
|
||||
|
||||
ensureReadable(docletClass);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -361,27 +358,6 @@ public class DocletInvoker {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the module of the given class is readable to this
|
||||
* module.
|
||||
* @param targetClass class in module to be made readable
|
||||
*/
|
||||
private void ensureReadable(Class<?> targetClass) {
|
||||
try {
|
||||
Method getModuleMethod = Class.class.getMethod("getModule");
|
||||
Object thisModule = getModuleMethod.invoke(this.getClass());
|
||||
Object targetModule = getModuleMethod.invoke(targetClass);
|
||||
|
||||
Class<?> moduleClass = getModuleMethod.getReturnType();
|
||||
Method addReadsMethod = moduleClass.getMethod("addReads", moduleClass);
|
||||
addReadsMethod.invoke(thisModule, targetModule);
|
||||
} catch (NoSuchMethodException e) {
|
||||
// ignore
|
||||
} catch (Exception e) {
|
||||
throw new InternalError(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export javadoc internal API to the unnamed module for a classloader.
|
||||
* This is to support continued use of existing non-standard doclets that
|
||||
|
||||
@ -246,7 +246,6 @@ public class TagletManager {
|
||||
}
|
||||
tagClassLoader = fileManager.getClassLoader(TAGLET_PATH);
|
||||
Class<?> customTagClass = tagClassLoader.loadClass(classname);
|
||||
ensureReadable(customTagClass);
|
||||
Object instance = customTagClass.newInstance();
|
||||
Taglet newLegacy = new UserTaglet((jdk.javadoc.doclet.taglet.Taglet)instance);
|
||||
String tname = newLegacy.getName();
|
||||
@ -261,27 +260,6 @@ public class TagletManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the module of the given class is readable to this
|
||||
* module.
|
||||
* @param targetClass class in module to be made readable
|
||||
*/
|
||||
private void ensureReadable(Class<?> targetClass) {
|
||||
try {
|
||||
Method getModuleMethod = Class.class.getMethod("getModule");
|
||||
Object thisModule = getModuleMethod.invoke(this.getClass());
|
||||
Object targetModule = getModuleMethod.invoke(targetClass);
|
||||
|
||||
Class<?> moduleClass = getModuleMethod.getReturnType();
|
||||
Method addReadsMethod = moduleClass.getMethod("addReads", moduleClass);
|
||||
addReadsMethod.invoke(thisModule, targetModule);
|
||||
} catch (NoSuchMethodException e) {
|
||||
// ignore
|
||||
} catch (Exception e) {
|
||||
throw new InternalError(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new <code>SimpleTaglet</code>. If this tag already exists
|
||||
* and the header passed as an argument is null, move tag to the back of the
|
||||
|
||||
@ -330,27 +330,6 @@ public class Start extends ToolOption.Helper {
|
||||
return !failed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the module of the given class is readable to this
|
||||
* module.
|
||||
* @param targetClass class in module to be made readable
|
||||
*/
|
||||
private void ensureReadable(Class<?> targetClass) {
|
||||
try {
|
||||
Method getModuleMethod = Class.class.getMethod("getModule");
|
||||
Object thisModule = getModuleMethod.invoke(this.getClass());
|
||||
Object targetModule = getModuleMethod.invoke(targetClass);
|
||||
|
||||
Class<?> moduleClass = getModuleMethod.getReturnType();
|
||||
Method addReadsMethod = moduleClass.getMethod("addReads", moduleClass);
|
||||
addReadsMethod.invoke(thisModule, targetModule);
|
||||
} catch (NoSuchMethodException e) {
|
||||
// ignore
|
||||
} catch (Exception e) {
|
||||
throw new InternalError(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main program - internal
|
||||
*/
|
||||
@ -550,7 +529,6 @@ public class Start extends ToolOption.Helper {
|
||||
}
|
||||
try {
|
||||
Class<?> klass = cl.loadClass(userDocletName);
|
||||
ensureReadable(klass);
|
||||
return klass;
|
||||
} catch (ClassNotFoundException cnfe) {
|
||||
error("main.doclet_class_not_found", userDocletName);
|
||||
@ -601,7 +579,6 @@ public class Start extends ToolOption.Helper {
|
||||
for (String tagletName : tagletNames) {
|
||||
try {
|
||||
Class<?> klass = cl.loadClass(tagletName);
|
||||
ensureReadable(klass);
|
||||
if (com.sun.tools.doclets.Taglet.class.isAssignableFrom(klass)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user