From hannesw at openjdk.java.net Mon Nov 2 10:58:06 2020 From: hannesw at openjdk.java.net (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Mon, 2 Nov 2020 10:58:06 GMT Subject: RFR: JDK-8245058: improve presentation of annotations for modules and packages Message-ID: JDK-8245058: improve presentation of annotations for modules and packages ------------- Commit messages: - Improve HtmlStyle documentation - JDK-8245058 unify signature generating code - Refactor and unify signature generating code - Add proper signatures to module and package pages Changes: https://git.openjdk.java.net/jdk/pull/966/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=966&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8245058 Stats: 1539 lines in 53 files changed: 611 ins; 446 del; 482 mod Patch: https://git.openjdk.java.net/jdk/pull/966.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/966/head:pull/966 PR: https://git.openjdk.java.net/jdk/pull/966 From hannesw at openjdk.java.net Mon Nov 2 11:46:57 2020 From: hannesw at openjdk.java.net (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Mon, 2 Nov 2020 11:46:57 GMT Subject: RFR: JDK-8245058: improve presentation of annotations for modules and packages In-Reply-To: References: Message-ID: On Fri, 30 Oct 2020 20:11:49 GMT, Hannes Walln?fer wrote: > JDK-8245058: improve presentation of annotations for modules and packages API docs: http://cr.openjdk.java.net/~hannesw/8245058/api.01/index.html Example module signature: http://cr.openjdk.java.net/~hannesw/8245058/api.01/java.base/module-summary.html Example package signature: http://cr.openjdk.java.net/~hannesw/8245058/api.01/java.base/java/lang/package-summary.html ------------- PR: https://git.openjdk.java.net/jdk/pull/966 From jjg at openjdk.java.net Mon Nov 2 17:52:56 2020 From: jjg at openjdk.java.net (Jonathan Gibbons) Date: Mon, 2 Nov 2020 17:52:56 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v4] In-Reply-To: References: <281-fNSKFfd-qngLAcLkMFdmKe-XHD-0qKCEh4OGvog=.82b534a0-e57a-41bf-ba94-e487601b2773@github.com> Message-ID: <0nw1ywk_bFqAUlU9DuC_79QXVgx63FEsf3Jwt_Y187M=.1164173f-b6d5-4f20-bc66-f722ebb0be08@github.com> On Thu, 29 Oct 2020 09:43:56 GMT, Jan Lahoda wrote: >> I don't think there should be much interaction with -source . We don't support preview features from previous version or preview class files from previous versions, so I think it should be enough to handle the currently present preview features. > > We don't support preview features from previous releases, AFAIK. So javadoc for JDK 16 should not accept e.g. record class when running with -source 15. Yeah, my recollection is that I was wondering whether preview-related code needs to be "guarded" to only work in the current release. But, I guess we may get the right effect (of forbidding preview features in older code) from the javac front end, so that in javadoc we can be assured that there are no instances of what may still be preview features in older code (i.e with older --source/--rlease options) ------------- PR: https://git.openjdk.java.net/jdk/pull/703 From jjg at openjdk.java.net Mon Nov 2 17:52:56 2020 From: jjg at openjdk.java.net (Jonathan Gibbons) Date: Mon, 2 Nov 2020 17:52:56 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v4] In-Reply-To: References: Message-ID: On Thu, 29 Oct 2020 09:26:05 GMT, Jan Lahoda wrote: >> src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java line 1288: >> >>> 1286: case FIELD: case INSTANCE_INIT: case LOCAL_VARIABLE: case PARAMETER: >>> 1287: case RESOURCE_VARIABLE: case STATIC_INIT: case TYPE_PARAMETER: >>> 1288: case RECORD_COMPONENT: >> >> I'm not saying this is wrong, but I'd like to understand why it is necessary. > > HtmlDocletWriter.getPreviewNotes analyzes classes and their members, to see if some are using aspects that are under preview. When looking at the members, it uses utils.isIncluded on the member, and that eventually gets here. And if the member is a RECORD_COMPONENT, it would fail here. But we can avoid asking for RECORD_COMPONENTS, if needed. ok ------------- PR: https://git.openjdk.java.net/jdk/pull/703 From jlahoda at openjdk.java.net Mon Nov 2 18:15:09 2020 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Mon, 2 Nov 2020 18:15:09 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v6] In-Reply-To: References: Message-ID: <0_WQkFp21--3oBLlFpJ-CN3ACeLwKEB21ByfD_LUl7Q=.831ed155-e36f-4bb9-8289-98e30042b65b@github.com> > This is an update to javac and javadoc, to introduce support for Preview APIs, and generally improve javac and javadoc behavior to more closely adhere to JEP 12. > > The notable changes are: > > * adding support for Preview APIs (javac until now supported primarily only preview language features, and APIs associated with preview language features). This includes: > * the @PreviewFeature annotation has boolean attribute "reflective", which should be true for reflective Preview APIs, false otherwise. This replaces the existing "essentialAPI" attribute with roughly inverted meaning. > * the preview warnings for preview APIs are auto-suppressed as described in the JEP 12. E.g. the module that declares the preview API is free to use it without warnings > * improving error/warning messages. Please see [1] for a list of cases/examples. > * class files are only marked as preview if they are using a preview feature. [1] also shows if a class file is marked as preview or not. > * the PreviewFeature annotation has been moved to jdk.internal.javac package (originally was in the jdk.internal package). > * Preview API in JDK's javadoc no longer needs to specify @preview tag in the source files. javadoc will auto-generate a note for @PreviewFeature elements, see e.g. [2] and [3] (non-reflective and reflective API, respectively). A summary of preview elements is also provided [4]. Existing uses of @preview have been updated/removed. > * non-JDK javadoc is also enhanced to auto-generate preview notes for uses of Preview elements, and for declaring elements using preview language features [5]. > > Please also see the CSR [6] for more information. > > [1] http://cr.openjdk.java.net/~jlahoda/8250768/JEP12-errors-warnings-v6.html > [2] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.base/java/lang/Record.html > [3] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.compiler/javax/lang/model/element/RecordComponentElement.html > [4] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/preview-list.html > [5] http://cr.openjdk.java.net/~jlahoda/8250768/test.javadoc.00/ > [6] https://bugs.openjdk.java.net/browse/JDK-8250769 Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 46 commits: - Removing trailing whitespace. - Merging master into JDK-8250768. - Updating tests after records are a final feature. - Fixing tests. - Finalizing removal of record preview hooks. - Merging master into JDK-8250768 - Reflecting review comments. - Merge branch 'master' into JDK-8250768 - Removing unnecessary cast. - Using a more correct way to get URLs. - ... and 36 more: https://git.openjdk.java.net/jdk/compare/d93e3a7d...2e403900 ------------- Changes: https://git.openjdk.java.net/jdk/pull/703/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=703&range=05 Stats: 3012 lines in 142 files changed: 2521 ins; 260 del; 231 mod Patch: https://git.openjdk.java.net/jdk/pull/703.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/703/head:pull/703 PR: https://git.openjdk.java.net/jdk/pull/703 From jjg at openjdk.java.net Mon Nov 2 20:25:10 2020 From: jjg at openjdk.java.net (Jonathan Gibbons) Date: Mon, 2 Nov 2020 20:25:10 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v6] In-Reply-To: <0_WQkFp21--3oBLlFpJ-CN3ACeLwKEB21ByfD_LUl7Q=.831ed155-e36f-4bb9-8289-98e30042b65b@github.com> References: <0_WQkFp21--3oBLlFpJ-CN3ACeLwKEB21ByfD_LUl7Q=.831ed155-e36f-4bb9-8289-98e30042b65b@github.com> Message-ID: <3jLIRMTBm23tqzjxY8zwTvMCL7zaZkLgjEKAUiCFc78=.279fb6fb-2f7f-4602-8ed5-5df354276a3e@github.com> On Mon, 2 Nov 2020 18:15:09 GMT, Jan Lahoda wrote: >> This is an update to javac and javadoc, to introduce support for Preview APIs, and generally improve javac and javadoc behavior to more closely adhere to JEP 12. >> >> The notable changes are: >> >> * adding support for Preview APIs (javac until now supported primarily only preview language features, and APIs associated with preview language features). This includes: >> * the @PreviewFeature annotation has boolean attribute "reflective", which should be true for reflective Preview APIs, false otherwise. This replaces the existing "essentialAPI" attribute with roughly inverted meaning. >> * the preview warnings for preview APIs are auto-suppressed as described in the JEP 12. E.g. the module that declares the preview API is free to use it without warnings >> * improving error/warning messages. Please see [1] for a list of cases/examples. >> * class files are only marked as preview if they are using a preview feature. [1] also shows if a class file is marked as preview or not. >> * the PreviewFeature annotation has been moved to jdk.internal.javac package (originally was in the jdk.internal package). >> * Preview API in JDK's javadoc no longer needs to specify @preview tag in the source files. javadoc will auto-generate a note for @PreviewFeature elements, see e.g. [2] and [3] (non-reflective and reflective API, respectively). A summary of preview elements is also provided [4]. Existing uses of @preview have been updated/removed. >> * non-JDK javadoc is also enhanced to auto-generate preview notes for uses of Preview elements, and for declaring elements using preview language features [5]. >> >> Please also see the CSR [6] for more information. >> >> [1] http://cr.openjdk.java.net/~jlahoda/8250768/JEP12-errors-warnings-v6.html >> [2] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.base/java/lang/Record.html >> [3] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/java.compiler/javax/lang/model/element/RecordComponentElement.html >> [4] http://cr.openjdk.java.net/~jlahoda/8250768/jdk.javadoc.00/api/preview-list.html >> [5] http://cr.openjdk.java.net/~jlahoda/8250768/test.javadoc.00/ >> [6] https://bugs.openjdk.java.net/browse/JDK-8250769 > > Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 46 commits: > > - Removing trailing whitespace. > - Merging master into JDK-8250768. > - Updating tests after records are a final feature. > - Fixing tests. > - Finalizing removal of record preview hooks. > - Merging master into JDK-8250768 > - Reflecting review comments. > - Merge branch 'master' into JDK-8250768 > - Removing unnecessary cast. > - Using a more correct way to get URLs. > - ... and 36 more: https://git.openjdk.java.net/jdk/compare/d93e3a7d...2e403900 I have read all the files. I have added a n umber of various minor non-blocking comments (no need for re-review( to fix these. But I have a couple of comments/questions before finally giving approval. There's a comment in `PreviewListWriter` about annotation members that needs too be addressed, and I wonder is RECORD and RECORD_COMPONENT need to be added into PreviewElementKind. src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java line 75: > 73: * A key for testing. > 74: */ > 75: TEST, Slightly weird src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskPool.java line 257: > 255: //when patching modules (esp. java.base), it may be impossible to > 256: //clear the symbols read from the patch path: > 257: polluted |= get(JavaFileManager.class).hasLocation(StandardLocation.PATCH_MODULE_PATH); OK, but looks unrelated to primary work src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java line 218: > 216: return Errors.PreviewFeatureDisabledClassfile(classfile, majorVersionToSource.get(majorVersion).name); > 217: } > 218: Up above in isPreview, lines 185-188, I'm supervised it's not a `switch` statement. (Can't annotate those lines directly) src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java line 89: > 87: @Override > 88: protected Content getDeprecatedOrPreviewLink(Element member) { > 89: Content content = new ContentBuilder(); Yeah the shorter name is good here and more in keeping with the code style src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java line 93: > 91: if (!utils.isConstructor(member)) { > 92: content.add("."); > 93: content.add(member.getSimpleName()); this is OK, but generally FYI, `Content` is now set up to allow chained method calls. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java line 436: > 434: configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement) > 435: .label(resources.getText("doclet.Class")) > 436: .skipPreview(true)); @hns General comment, not directly related to this review: is it worth a cleanup to fold the sequence `getLink(new LinkInfoImpl(...))` into a hypothetical new `LinkBuilder` ? src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java line 221: > 219: if (modifiers.endsWith(" ")) { > 220: pre.add(" "); > 221: } Obligatory ugh that `modifiers` is a string and that it might end with a space. This is a possibility for future cleanup. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java line 283: > 281: if (isFirst) { > 282: pre.add(DocletConstants.NL); > 283: pre.add("permits"); Note for javadoc-dev folk: we should have a better more consistent way of handling keywords src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java line 254: > 252: contentTree.add(section); > 253: } > 254: ?? src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java line 145: > 143: // which performs a somewhat similar role > 144: public enum ConditionalPage { > 145: CONSTANT_VALUES, DEPRECATED, PREVIEW, SERIALIZED_FORM, SYSTEM_PROPERTIES ?? src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java line 120: > 118: title, > 119: classLinkInfo.target)); > 120: if (flags.contains(ElementFlag.PREVIEW)) { I see a lot of `new HtmlTree(TagName.SUP).add(...)` ... enough to warrant a new factory method ``HtmlTree.SUP(Content)` or similar. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java line 39: > 37: import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; > 38: import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; > 39: import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml; Are these imports still required? src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PreviewListWriter.java line 40: > 38: > 39: import com.sun.source.doctree.DocTree; > 40: import javax.lang.model.element.ElementKind; unordered imports src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PreviewListWriter.java line 223: > 221: case CONSTRUCTOR -> new ConstructorWriterImpl(this); > 222: case ENUM_CONSTANT -> new EnumConstantWriterImpl(this); > 223: case ANNOTATION_TYPE_MEMBER -> new AnnotationTypeOptionalMemberWriterImpl(this, null); Hmmm. Not sure about this one. For better or worse, javadoc current handles optional and required members differently (i.e. with different classes). That's arguably something that should be cleaned up at some point, but in the meantime, I'm surprised to not see the distinction here. I guess if we're not likely to see an interaction between preview-ness and annotation-members, this will not likely show up in practice. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PreviewListWriter.java line 67: > 65: public class PreviewListWriter extends SubWriterHolderWriter { > 66: > 67: private String getAnchorName(PreviewElementKind kind) { 1. I'm mildly surprised to not see anything record-related here. 2. I'm mildly surprised you haven't used the new switch-expression syntax. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/PreviewAPIListBuilder.java line 67: > 65: ENUM_CONSTANT, > 66: ANNOTATION_TYPE_MEMBER // no ElementKind mapping > 67: }; Should there be RECORD and RECORD_COMPONENT in this list? src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java line 932: > 930: switch (tagName) { > 931: case A: case BUTTON: case BR: case CODE: case EM: case I: case IMG: > 932: case LABEL: case SMALL: case SPAN: case STRONG: case SUB: case SUP: See comment elsewhere about possibly adding a factory method for `SUP` trees. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties line 290: > 288: doclet.Declared_Using_Preview.SEALED_PERMITS=Sealed Classes > 289: doclet.PreviewPlatformLeadingNote={0} is a preview API of the Java platform. > 290: doclet.ReflectivePreviewPlatformLeadingNote={0} is a reflective preview API of the Java platform. Question: is the following "inconsistency" deliberate: 1. Java platform 2. Java language 3. Java SE (in javac diagnostics) src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/FieldWriter.java line 75: > 73: > 74: /** > 75: * Add the preview output for the given member. (minor) Should be "Adds" src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/MethodWriter.java line 75: > 73: > 74: /** > 75: * Add the preview output for the given member. (minor) should be "Adds" src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java line 156: > 154: buildSignature(annotationDocTree); > 155: buildDeprecationInfo(annotationDocTree); > 156: buildPreviewInfo(annotationDocTree); (Just checking) I presume this behavior is inherited into `AnnotationTypeOptionalMemberBuilder` so no changes required there. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java line 166: > 164: writer.addPreview(currentElement, enumConstantsTree); > 165: } > 166: Note to self: I regret that this duplication of adding this method everywhere seems to be necessary. This would be good to clean up at some point. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties line 213: > 211: doclet.Preview=Preview. > 212: doclet.Properties=Properties > 213: doclet.constructors=constructors Is the period after `Preview` intentional? It seems inconsistent. src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Comparators.java line 131: > 129: /** > 130: * Returns a Comparator for deprecated items listed on deprecated list page, by comparing the > 131: * fully qualified names, and if those are equal the names of the enclosing modules. Comment does not match method name src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java line 132: > 130: import static com.sun.source.doctree.DocTree.Kind.*; > 131: import javax.lang.model.AnnotatedConstruct; > 132: import javax.lang.model.util.SimpleAnnotationValueVisitor14; unordered imports test/langtools/jdk/javadoc/doclet/testPreview/TestPreview.java line 75: > 73: """; > 74: String expected = MessageFormat.format(expectedTemplate, zero, one, two, three); > 75: checkOutput("m/pkg/TestPreviewDeclaration.html", true, expected); Interesting technique... Future: it might be interesting to consider folding the bundle access on line 59 into a utility call in JavadocTester test/langtools/jdk/javadoc/doclet/testPreview/api/preview/Core.java line 28: > 26: import jdk.internal.javac.PreviewFeature.Feature; > 27: > 28: @PreviewFeature(feature=Feature.TEST) Yeah, I remember `Feature.TEST` from earlier. I guess it's OK for now, as a workaround for a testing a feature which is inherently, by design, a moving target across releases. These days, javadoc tests are trending towards generating small sample test programs, instead of having small static side-files dominated by a legal header. I wonder if there is a possibility of having a "generator class" in the `javadoc.tester` package that can generate sample code using one or more of the current set of preview features, as a way of reducing the need for the TEST feature. test/langtools/tools/javac/patterns/BindingsTest2.out line 54: > 52: - compiler.note.preview.filename: BindingsTest2.java, DEFAULT > 53: - compiler.note.preview.recompile > 54: 51 errors (issue unrelated to review) it seems wrong that we encourage/allow the use of files that do not end in newline. test/langtools/tools/javac/preview/PreviewAutoSuppress.java line 25: > 23: > 24: /* > 25: * @test no `@bug`? test/langtools/tools/javac/preview/PreviewErrors.java line 38: > 36: * @build toolbox.ToolBox toolbox.JavacTask > 37: * @build combo.ComboTestHelper > 38: * @compile PreviewErrors.java do you need `@compile` here: is `@build` not good enough? ------------- PR: https://git.openjdk.java.net/jdk/pull/703 From jjg at openjdk.java.net Mon Nov 2 20:25:12 2020 From: jjg at openjdk.java.net (Jonathan Gibbons) Date: Mon, 2 Nov 2020 20:25:12 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v6] In-Reply-To: <5xE8fziHH9n04bSHhODnOB9On3t_zGz-JY0gJhVhP74=.0c79430f-fac0-44f9-82be-40ef2f94a0d9@github.com> References: <5xE8fziHH9n04bSHhODnOB9On3t_zGz-JY0gJhVhP74=.0c79430f-fac0-44f9-82be-40ef2f94a0d9@github.com> Message-ID: <8FF_CARupWr7LcKZm5Th7wpIZ-QhNVOM_KytRUOPppE=.bf38fc0c-5c70-4bff-aa50-fe23c772fe2b@github.com> On Fri, 16 Oct 2020 16:07:41 GMT, Maurizio Cimadamore wrote: >> Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 46 commits: >> >> - Removing trailing whitespace. >> - Merging master into JDK-8250768. >> - Updating tests after records are a final feature. >> - Fixing tests. >> - Finalizing removal of record preview hooks. >> - Merging master into JDK-8250768 >> - Reflecting review comments. >> - Merge branch 'master' into JDK-8250768 >> - Removing unnecessary cast. >> - Using a more correct way to get URLs. >> - ... and 36 more: https://git.openjdk.java.net/jdk/compare/d93e3a7d...2e403900 > > src/jdk.compiler/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java line 166: > >> 164: s = "compiler.misc.tree.tag." + StringUtils.toLowerCase(((Tag) arg).name()); >> 165: } else if (arg instanceof Source && arg == Source.DEFAULT && >> 166: CODES_NEEDING_SOURCE_NORMALIZATION.contains(diag.getCode())) { > > Nice trick to keep raw output constant across versions :-) ?? ------------- PR: https://git.openjdk.java.net/jdk/pull/703 From jjg at openjdk.java.net Mon Nov 2 20:25:12 2020 From: jjg at openjdk.java.net (Jonathan Gibbons) Date: Mon, 2 Nov 2020 20:25:12 GMT Subject: RFR: JDK-8250768: javac should be adapted to changes in JEP 12 [v4] In-Reply-To: <281-fNSKFfd-qngLAcLkMFdmKe-XHD-0qKCEh4OGvog=.82b534a0-e57a-41bf-ba94-e487601b2773@github.com> References: <281-fNSKFfd-qngLAcLkMFdmKe-XHD-0qKCEh4OGvog=.82b534a0-e57a-41bf-ba94-e487601b2773@github.com> Message-ID: On Tue, 27 Oct 2020 16:09:45 GMT, Jan Lahoda wrote: >> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java line 88: >> >>> 86: >>> 87: @Override >>> 88: protected Content getDeprecatedOrPreviewLink(Element member) { >> >> This name is a side-effect of the `ElementFlag` question. We should either use explicit field and method names, or we should use `ElementFlag` more consistently. This method name works OK for now, but if if ever gets to have another `orFoo` component in the name, the signature should be parameterized with something like `ElementFlag` or its equivalent. > > Note this method returns the same link for deprecate or preview - it just was named "getDeprecatedLink", and when using it work preview, I renamed it "getDeprecatedOrPreviewLink". We may need to think of a better name. This name is OK for now. Maybe we'll have m ore insight into a better name if/when we add a third variant ;-) ------------- PR: https://git.openjdk.java.net/jdk/pull/703 From hannesw at openjdk.java.net Tue Nov 3 10:28:02 2020 From: hannesw at openjdk.java.net (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Tue, 3 Nov 2020 10:28:02 GMT Subject: RFR: JDK-8248320: Provide a unique accessible name for