Skip to content
Permalink
Browse files
8261623: reference to javac internals in Extern class
Reviewed-by: hannesw
  • Loading branch information
jonathan-gibbons committed Feb 12, 2021
1 parent 350303d commit 3aa1b4c72c289093a6d5894322978ba02acf5ef1
Showing 2 changed files with 13 additions and 13 deletions.
@@ -198,6 +198,18 @@ public TypeElement searchClass(TypeElement klass, String className) {
return elementUtils.getTypeElement(className);
}


// TODO: The following should be replaced by a new method such as Elements.isAutomaticModule
// see JDK-8261625
public boolean isAutomaticModule(ModuleElement me) {
if (me == null) {
return false;
} else {
ModuleSymbol msym = (ModuleSymbol) me;
return (msym.flags() & Flags.AUTOMATIC_MODULE) != 0;
}
}

// TODO: need to re-implement this using j.l.m. correctly!, this has
// implications on testInterface, the note here is that javac's supertype
// does the right thing returning Parameters in scope.
@@ -47,8 +47,6 @@
import javax.tools.Diagnostic.Kind;
import javax.tools.DocumentationTool;

import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.code.Symbol.ModuleSymbol;
import jdk.javadoc.doclet.Reporter;
import jdk.javadoc.internal.doclets.toolkit.AbstractDoclet;
import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
@@ -575,7 +573,7 @@ private String checkLinkCompatibility(String packageName, String moduleName, Str
return DocletConstants.DEFAULT_ELEMENT_NAME;
} else if (moduleName == null) {
// suppress the warning message in the case of automatic modules
if (!isAutomaticModule(me) && issueWarning) {
if (!configuration.workArounds.isAutomaticModule(me) && issueWarning) {
configuration.getReporter().print(Kind.WARNING,
resources.getText("doclet.linkMismatch_ModuleLinkedtoPackage", path));
}
@@ -586,16 +584,6 @@ private String checkLinkCompatibility(String packageName, String moduleName, Str
return moduleName == null ? DocletConstants.DEFAULT_ELEMENT_NAME : moduleName;
}

// The following should be replaced by a new method such as Elements.isAutomaticModule
private boolean isAutomaticModule(ModuleElement me) {
if (me == null) {
return false;
} else {
ModuleSymbol msym = (ModuleSymbol) me;
return (msym.flags() & Flags.AUTOMATIC_MODULE) != 0;
}
}

public boolean isUrl (String urlCandidate) {
try {
new URL(urlCandidate);

1 comment on commit 3aa1b4c

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 3aa1b4c Feb 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.