From hannes.wallnoefer at oracle.com Wed Jan 8 11:31:03 2020 From: hannes.wallnoefer at oracle.com (=?utf-8?Q?Hannes_Walln=C3=B6fer?=) Date: Wed, 8 Jan 2020 12:31:03 +0100 Subject: RFR: 8220002: Improve anchor definitions in generated files Message-ID: Please review: JBS: https://bugs.openjdk.java.net/browse/JDK-8220002 Webrev: http://cr.openjdk.java.net/~hannesw/8220002/webrev.01/ API docs: http://cr.openjdk.java.net/~hannesw/8220002/api.01/ In places where a
tag is available I always moved the id attribute there instead of the heading. This required a bit more changes in some places, but was necessary to get the anchoring position right (see for example the section and individual member anchors in type pages, both of which are now just right IMO). This patch should cover all occurrences of tags in generated docs, but there are still dozens in static HTML files. I?ll file a separate issue for those. Hannes From jonathan.gibbons at oracle.com Fri Jan 10 01:10:38 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 9 Jan 2020 17:10:38 -0800 Subject: RFR: 8220002: Improve anchor definitions in generated files In-Reply-To: References: Message-ID: <1c0e932c-365a-8d34-6262-575c5cfa6313@oracle.com> Generally wonderful (i.e generally approved.) I like the new HtmlTree.setId method and the fluent use at most use sites. There were a couple of places that did not use fluent invocation, that easily could be updated, but that's not a big deal.? I also like the amount of anchor-related code that got simplified or removed. I'm not entirely convinced the new HtmlTree.SPAN_ID carries it's own weight: I agree it is a natural conversion from the previous A_ID, but it seems that in some places the id could have been moved onto an enclosing node. Not a big deal at this time, especially as changing this would affect tests. There are some places/changes with questionable code, but it was never new questionable code; it was code that was previously questionable that was being updated or moved.? Now is not really the time to clean stuff like that up. I looked at the generated docs, scanning for instances of " Please review: > > JBS: https://bugs.openjdk.java.net/browse/JDK-8220002 > Webrev: http://cr.openjdk.java.net/~hannesw/8220002/webrev.01/ > API docs: http://cr.openjdk.java.net/~hannesw/8220002/api.01/ > > In places where a
tag is available I always moved the id attribute there instead of the heading. This required a bit more changes in some places, but was necessary to get the anchoring position right (see for example the section and individual member anchors in type pages, both of which are now just right IMO). > > This patch should cover all occurrences of tags in generated docs, but there are still dozens in static HTML files. I?ll file a separate issue for those. > > Hannes From dawid.weiss at gmail.com Fri Jan 10 15:12:06 2020 From: dawid.weiss at gmail.com (Dawid Weiss) Date: Fri, 10 Jan 2020 16:12:06 +0100 Subject: Repeated lint option parsing and difference in behavior Message-ID: Hello, I just filed a bug for Lucene [1] but I can't explain why there is a difference between calling javadoc with several lint options: javadoc ... -Xdoclint:all -Xdoclint:-missing -Xdoclint:-accessibility versus aggregating them in one line: javadoc ... -Xdoclint:all,-missing,-accessibility It seems to me that the first version disables everything -- none of the lint options are running (no errors are reported) while the second version seems to work just fine. Am I missing something? Dawid [1] https://issues.apache.org/jira/browse/LUCENE-9126 From jonathan.gibbons at oracle.com Fri Jan 10 15:45:38 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Fri, 10 Jan 2020 07:45:38 -0800 Subject: Repeated lint option parsing and difference in behavior In-Reply-To: References: Message-ID: Dawid, Thanks for reporting this. If this is the case, it is a bug. I'll investigate and file a bug if necessary. -- Jon On 1/10/20 7:12 AM, Dawid Weiss wrote: > Hello, > > I just filed a bug for Lucene [1] but I can't explain why there is a > difference between calling javadoc with several lint options: > > javadoc ... -Xdoclint:all -Xdoclint:-missing -Xdoclint:-accessibility > > versus aggregating them in one line: > > javadoc ... -Xdoclint:all,-missing,-accessibility > > It seems to me that the first version disables everything -- none of > the lint options are running (no errors are reported) while the second > version seems to work just fine. > > Am I missing something? > > Dawid > > [1] https://issues.apache.org/jira/browse/LUCENE-9126 From jonathan.gibbons at oracle.com Fri Jan 10 22:43:15 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Fri, 10 Jan 2020 14:43:15 -0800 Subject: Repeated lint option parsing and difference in behavior In-Reply-To: References: Message-ID: Filed https://bugs.openjdk.java.net/browse/JDK-8236949 -- Jon On 01/10/2020 07:45 AM, Jonathan Gibbons wrote: > Dawid, > > Thanks for reporting this. If this is the case, it is a bug. > I'll investigate and file a bug if necessary. > > -- Jon > > On 1/10/20 7:12 AM, Dawid Weiss wrote: >> Hello, >> >> I just filed a bug for Lucene [1] but I can't explain why there is a >> difference between calling javadoc with several lint options: >> >> javadoc ... -Xdoclint:all -Xdoclint:-missing -Xdoclint:-accessibility >> >> versus aggregating them in one line: >> >> javadoc ... -Xdoclint:all,-missing,-accessibility >> >> It seems to me that the first version disables everything -- none of >> the lint options are running (no errors are reported) while the second >> version seems to work just fine. >> >> Am I missing something? >> >> Dawid >> >> [1] https://issues.apache.org/jira/browse/LUCENE-9126 From jonathan.gibbons at oracle.com Sun Jan 12 16:43:30 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Sun, 12 Jan 2020 08:43:30 -0800 Subject: Repeated lint option parsing and difference in behavior In-Reply-To: References: Message-ID: <56cef729-e6f5-b4ef-0559-a8f11c72dcbc@oracle.com> Yes, that is as I would expect. Much of the code was rewritten in JDK 9. As for backports, the first job is to fix the latest version. It's a separate decision whether it should be backported. -- Jon On 1/11/20 6:50 AM, Dawid Weiss wrote: > For the record -- Java 8 works as expected, Java 9 and on does not. > > Dawid > > On Sat, Jan 11, 2020 at 3:41 PM Dawid Weiss wrote: >> Thank you, Jon. >> >> From what I can see on github this buggy scenario is fairly common... >> I checked with Java 11 on and it's present in all versions up to the >> most recent one. Should it be backported to LTS releases? >> >> Dawid >> >> On Fri, Jan 10, 2020 at 11:43 PM Jonathan Gibbons >> wrote: >>> Filed >>> >>> https://bugs.openjdk.java.net/browse/JDK-8236949 >>> >>> -- Jon >>> >>> On 01/10/2020 07:45 AM, Jonathan Gibbons wrote: >>>> Dawid, >>>> >>>> Thanks for reporting this. If this is the case, it is a bug. >>>> I'll investigate and file a bug if necessary. >>>> >>>> -- Jon >>>> >>>> On 1/10/20 7:12 AM, Dawid Weiss wrote: >>>>> Hello, >>>>> >>>>> I just filed a bug for Lucene [1] but I can't explain why there is a >>>>> difference between calling javadoc with several lint options: >>>>> >>>>> javadoc ... -Xdoclint:all -Xdoclint:-missing -Xdoclint:-accessibility >>>>> >>>>> versus aggregating them in one line: >>>>> >>>>> javadoc ... -Xdoclint:all,-missing,-accessibility >>>>> >>>>> It seems to me that the first version disables everything -- none of >>>>> the lint options are running (no errors are reported) while the second >>>>> version seems to work just fine. >>>>> >>>>> Am I missing something? >>>>> >>>>> Dawid >>>>> >>>>> [1] https://issues.apache.org/jira/browse/LUCENE-9126 From dawid.weiss at gmail.com Sat Jan 11 14:41:38 2020 From: dawid.weiss at gmail.com (Dawid Weiss) Date: Sat, 11 Jan 2020 15:41:38 +0100 Subject: Repeated lint option parsing and difference in behavior In-Reply-To: References: Message-ID: Thank you, Jon. >From what I can see on github this buggy scenario is fairly common... I checked with Java 11 on and it's present in all versions up to the most recent one. Should it be backported to LTS releases? Dawid On Fri, Jan 10, 2020 at 11:43 PM Jonathan Gibbons wrote: > > Filed > > https://bugs.openjdk.java.net/browse/JDK-8236949 > > -- Jon > > On 01/10/2020 07:45 AM, Jonathan Gibbons wrote: > > Dawid, > > > > Thanks for reporting this. If this is the case, it is a bug. > > I'll investigate and file a bug if necessary. > > > > -- Jon > > > > On 1/10/20 7:12 AM, Dawid Weiss wrote: > >> Hello, > >> > >> I just filed a bug for Lucene [1] but I can't explain why there is a > >> difference between calling javadoc with several lint options: > >> > >> javadoc ... -Xdoclint:all -Xdoclint:-missing -Xdoclint:-accessibility > >> > >> versus aggregating them in one line: > >> > >> javadoc ... -Xdoclint:all,-missing,-accessibility > >> > >> It seems to me that the first version disables everything -- none of > >> the lint options are running (no errors are reported) while the second > >> version seems to work just fine. > >> > >> Am I missing something? > >> > >> Dawid > >> > >> [1] https://issues.apache.org/jira/browse/LUCENE-9126 > From dawid.weiss at gmail.com Sat Jan 11 14:50:36 2020 From: dawid.weiss at gmail.com (Dawid Weiss) Date: Sat, 11 Jan 2020 15:50:36 +0100 Subject: Repeated lint option parsing and difference in behavior In-Reply-To: References: Message-ID: For the record -- Java 8 works as expected, Java 9 and on does not. Dawid On Sat, Jan 11, 2020 at 3:41 PM Dawid Weiss wrote: > > Thank you, Jon. > > From what I can see on github this buggy scenario is fairly common... > I checked with Java 11 on and it's present in all versions up to the > most recent one. Should it be backported to LTS releases? > > Dawid > > On Fri, Jan 10, 2020 at 11:43 PM Jonathan Gibbons > wrote: > > > > Filed > > > > https://bugs.openjdk.java.net/browse/JDK-8236949 > > > > -- Jon > > > > On 01/10/2020 07:45 AM, Jonathan Gibbons wrote: > > > Dawid, > > > > > > Thanks for reporting this. If this is the case, it is a bug. > > > I'll investigate and file a bug if necessary. > > > > > > -- Jon > > > > > > On 1/10/20 7:12 AM, Dawid Weiss wrote: > > >> Hello, > > >> > > >> I just filed a bug for Lucene [1] but I can't explain why there is a > > >> difference between calling javadoc with several lint options: > > >> > > >> javadoc ... -Xdoclint:all -Xdoclint:-missing -Xdoclint:-accessibility > > >> > > >> versus aggregating them in one line: > > >> > > >> javadoc ... -Xdoclint:all,-missing,-accessibility > > >> > > >> It seems to me that the first version disables everything -- none of > > >> the lint options are running (no errors are reported) while the second > > >> version seems to work just fine. > > >> > > >> Am I missing something? > > >> > > >> Dawid > > >> > > >> [1] https://issues.apache.org/jira/browse/LUCENE-9126 > > From dawid.weiss at gmail.com Mon Jan 13 17:31:30 2020 From: dawid.weiss at gmail.com (Dawid Weiss) Date: Mon, 13 Jan 2020 18:31:30 +0100 Subject: Sources read from classpath JARs cause errors during compilation Message-ID: Here is another gem I discovered while porting an ant build to gradle. Applies to Java 11-14. Say you're compiling class Bat like this: javadoc -classpath p2.jar -d tmp p3/bat/Bat.java p2 contains class Baz which Bat imports. Baz in turn has a reference to a class not on classpath (annotation, for example). The runtime behavior now forks into two scenarios: 1) p2 contains just Baz.class: compilation succeeds, documentation is generated. 1) p2 contains Baz.class AND Baz.java (sources inside the archive): javadoc fails with something like this: Loading source file p3\bat\Bat.java... Constructing Javadoc information... O:\repos\lucene-gradle-master\solr\solrj\build\tmp\repro\p2.jar(/baz/Baz.java):3: error: package bar does not exist import bar.Bar; ^ O:\repos\lucene-gradle-master\solr\solrj\build\tmp\repro\p2.jar(/baz/Baz.java):5: error: cannot find symbol @Bar ^ symbol: class Bar 2 errors Note the error message refers to the source file from classpath (!), not javadoc's source path. This causes grief when you don't have control over classpath entries. In Lucene's case it's this one: zookeeper-jute-3.5.5.jar(/org/apache/zookeeper/data/Stat.java):23: error: package org.apache.yetus.audience does not exist import org.apache.yetus.audience.InterfaceAudience; ^ A repro code for the above is attached to the Lucene issue at [1] (can't send attachments from gmail). Dawid [1] https://issues.apache.org/jira/browse/LUCENE-9132 From jonathan.gibbons at oracle.com Mon Jan 13 18:56:38 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Mon, 13 Jan 2020 10:56:38 -0800 Subject: Sources read from classpath JARs cause errors during compilation In-Reply-To: References: Message-ID: Dawid, Hmm, interesting case. Thanks for reporting, complete with a description of the stripped down test-case. For what it's worth, this looks like a javac issue more than a javadoc issue, because for the most part, javadoc delegates path handling and source/class loading to javac. -- Jon On 01/13/2020 09:31 AM, Dawid Weiss wrote: > Here is another gem I discovered while porting an ant build to gradle. > Applies to Java 11-14. Say you're compiling class Bat like this: > > javadoc -classpath p2.jar -d tmp p3/bat/Bat.java > > p2 contains class Baz which Bat imports. Baz in turn has a reference > to a class not on classpath (annotation, for example). > > The runtime behavior now forks into two scenarios: > > 1) p2 contains just Baz.class: compilation succeeds, documentation is generated. > > 1) p2 contains Baz.class AND Baz.java (sources inside the archive): > javadoc fails with something like this: > > Loading source file p3\bat\Bat.java... > Constructing Javadoc information... > O:\repos\lucene-gradle-master\solr\solrj\build\tmp\repro\p2.jar(/baz/Baz.java):3: > error: package bar does not exist > import bar.Bar; > ^ > O:\repos\lucene-gradle-master\solr\solrj\build\tmp\repro\p2.jar(/baz/Baz.java):5: > error: cannot find symbol > @Bar > ^ > symbol: class Bar > 2 errors > > Note the error message refers to the source file from classpath (!), > not javadoc's source path. > > This causes grief when you don't have control over classpath entries. > In Lucene's case it's this one: > > zookeeper-jute-3.5.5.jar(/org/apache/zookeeper/data/Stat.java):23: > error: package org.apache.yetus.audience does not exist > import org.apache.yetus.audience.InterfaceAudience; > ^ > > A repro code for the above is attached to the Lucene issue at [1] > (can't send attachments from gmail). > > Dawid > > [1] https://issues.apache.org/jira/browse/LUCENE-9132 From jonathan.gibbons at oracle.com Wed Jan 15 00:23:31 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 14 Jan 2020 16:23:31 -0800 Subject: RFR: JDK-8223536 jdk/javadoc/doclet/MetaTag/MetaTag.java still fails when run across midnight Message-ID: <70713c0c-fde3-fe63-5a83-1fb086f5da64@oracle.com> Please review a fix for a problem that occurs when a test is run across midnight. Although it is difficult to confirm the root cause, and equally difficult to test, the root cause is believed to be a static final instance of java.util.Calendar that is used to obtain the date written into the generated files, and which is subsequently verified by tests. When javadoc is run multiple times in the same JVM, as will occur when running the MetaTag.java test, the static final Calendar may be initialized to a time that is outside the range checked by the test. The fix is to replace the static instance by a non-static instance created in HtmlConfiguration. The fix is noreg-hard, because it can only be fully tested by running within milliseconds of midnight. It's remarkable that this has actually occurred multiple times in productio build/test runs. -- Jon JBS: https://bugs.openjdk.java.net/browse/JDK-8223536 Webrev: http://cr.openjdk.java.net/~jjg/8223536/webrev/ From pavel.rappo at oracle.com Wed Jan 15 13:51:36 2020 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Wed, 15 Jan 2020 13:51:36 +0000 Subject: RFR: JDK-8223536 jdk/javadoc/doclet/MetaTag/MetaTag.java still fails when run across midnight In-Reply-To: <70713c0c-fde3-fe63-5a83-1fb086f5da64@oracle.com> References: <70713c0c-fde3-fe63-5a83-1fb086f5da64@oracle.com> Message-ID: Three dates are created in succession: (1) `startDate` on MetaTag:103, (2) `startTime` on HtmlConfiguration:265, and `date` on MetaTag:95. If dates (1) and (3) are equal, we then conclude that (2) must be the same as (1) and (3). If I read the intent correctly, this implication warrants the conditional logic on MetaTag:96. This looks reasonable, provided we are not concerned with other date sorcery. Maybe one of these days we could switch to the more modern java.time API. Looks good to me. -Pavel > On 15 Jan 2020, at 00:23, Jonathan Gibbons wrote: > > Please review a fix for a problem that occurs when a test is run across midnight. > > Although it is difficult to confirm the root cause, and equally difficult to test, the root cause is believed to be a static final instance of java.util.Calendar that is used to obtain the date written into the generated files, and which is subsequently verified by tests. When javadoc is run multiple times in the same JVM, as will occur when running the MetaTag.java test, the static final Calendar may be initialized to a time that is outside the range checked by the test. > > The fix is to replace the static instance by a non-static instance created in HtmlConfiguration. > > The fix is noreg-hard, because it can only be fully tested by running within milliseconds of midnight. It's remarkable that this has actually occurred multiple times in productio build/test runs. > > -- Jon > > > JBS: https://bugs.openjdk.java.net/browse/JDK-8223536 > Webrev: http://cr.openjdk.java.net/~jjg/8223536/webrev/ > From Roger.Riggs at oracle.com Wed Jan 15 14:38:12 2020 From: Roger.Riggs at oracle.com (Roger Riggs) Date: Wed, 15 Jan 2020 09:38:12 -0500 Subject: RFR: JDK-8223536 jdk/javadoc/doclet/MetaTag/MetaTag.java still fails when run across midnight In-Reply-To: <70713c0c-fde3-fe63-5a83-1fb086f5da64@oracle.com> References: <70713c0c-fde3-fe63-5a83-1fb086f5da64@oracle.com> Message-ID: A bold suggestion is to switch to using java.time and move on from the legacy java.Date. On 1/14/20 7:23 PM, Jonathan Gibbons wrote: > Please review a fix for a problem that occurs when a test is run > across midnight. > > Although it is difficult to confirm the root cause, and equally > difficult to test, the root cause is believed to be a static final > instance of java.util.Calendar that is used to obtain the date written > into the generated files, and which is subsequently verified by tests. > When javadoc is run multiple times in the same JVM, as will occur when > running the MetaTag.java test, the static final Calendar may be > initialized to a time that is outside the range checked by the test. > > The fix is to replace the static instance by a non-static instance > created in HtmlConfiguration. > > The fix is noreg-hard, because it can only be fully tested by running > within milliseconds of midnight. It's remarkable that this has > actually occurred multiple times in productio build/test runs. > > -- Jon > > > JBS: https://bugs.openjdk.java.net/browse/JDK-8223536 > Webrev: http://cr.openjdk.java.net/~jjg/8223536/webrev/ > From jonathan.gibbons at oracle.com Wed Jan 15 15:42:09 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Wed, 15 Jan 2020 07:42:09 -0800 Subject: RFR: JDK-8223536 jdk/javadoc/doclet/MetaTag/MetaTag.java still fails when run across midnight In-Reply-To: References: <70713c0c-fde3-fe63-5a83-1fb086f5da64@oracle.com> Message-ID: <0f0dbbf7-53ce-17e5-26d8-b6eda2b8f353@oracle.com> Thanks. -- Jon On 1/15/20 5:51 AM, Pavel Rappo wrote: > Three dates are created in succession: (1) `startDate` on MetaTag:103, (2) `startTime` on HtmlConfiguration:265, and `date` > on MetaTag:95. If dates (1) and (3) are equal, we then conclude that (2) must be the same as (1) and (3). If I read the intent correctly, this implication warrants the conditional logic on MetaTag:96. > > This looks reasonable, provided we are not concerned with other date sorcery. Maybe one of these days we could switch to the more modern java.time API. Looks good to me. > > -Pavel > >> On 15 Jan 2020, at 00:23, Jonathan Gibbons wrote: >> >> Please review a fix for a problem that occurs when a test is run across midnight. >> >> Although it is difficult to confirm the root cause, and equally difficult to test, the root cause is believed to be a static final instance of java.util.Calendar that is used to obtain the date written into the generated files, and which is subsequently verified by tests. When javadoc is run multiple times in the same JVM, as will occur when running the MetaTag.java test, the static final Calendar may be initialized to a time that is outside the range checked by the test. >> >> The fix is to replace the static instance by a non-static instance created in HtmlConfiguration. >> >> The fix is noreg-hard, because it can only be fully tested by running within milliseconds of midnight. It's remarkable that this has actually occurred multiple times in productio build/test runs. >> >> -- Jon >> >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8223536 >> Webrev: http://cr.openjdk.java.net/~jjg/8223536/webrev/ >> From jonathan.gibbons at oracle.com Wed Jan 15 15:45:49 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Wed, 15 Jan 2020 07:45:49 -0800 Subject: RFR: JDK-8223536 jdk/javadoc/doclet/MetaTag/MetaTag.java still fails when run across midnight In-Reply-To: References: <70713c0c-fde3-fe63-5a83-1fb086f5da64@oracle.com> Message-ID: <8152e8e6-0a2b-8bb3-aed3-5ec6716f7627@oracle.com> Roger, Thanks for the suggestion. The old code used Calendar, but deep down in the impl, I see even that used Date.?? Given that the requirements are very very low, that the code is not using any Deprecated methods on Date, and the difficulty of reliably testing in this area, it seemed like staying with Date was "good enough". -- Jon On 1/15/20 6:38 AM, Roger Riggs wrote: > A bold suggestion is to switch to using java.time and move on from the > legacy java.Date. > > On 1/14/20 7:23 PM, Jonathan Gibbons wrote: >> Please review a fix for a problem that occurs when a test is run >> across midnight. >> >> Although it is difficult to confirm the root cause, and equally >> difficult to test, the root cause is believed to be a static final >> instance of java.util.Calendar that is used to obtain the date >> written into the generated files, and which is subsequently verified >> by tests. When javadoc is run multiple times in the same JVM, as will >> occur when running the MetaTag.java test, the static final Calendar >> may be initialized to a time that is outside the range checked by the >> test. >> >> The fix is to replace the static instance by a non-static instance >> created in HtmlConfiguration. >> >> The fix is noreg-hard, because it can only be fully tested by running >> within milliseconds of midnight. It's remarkable that this has >> actually occurred multiple times in productio build/test runs. >> >> -- Jon >> >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8223536 >> Webrev: http://cr.openjdk.java.net/~jjg/8223536/webrev/ >> > From hannes.wallnoefer at oracle.com Wed Jan 15 18:46:29 2020 From: hannes.wallnoefer at oracle.com (=?utf-8?Q?Hannes_Walln=C3=B6fer?=) Date: Wed, 15 Jan 2020 19:46:29 +0100 Subject: RFR: 8224052: Javadoc doesn't handle non-public intermediate types well Message-ID: <50D0BDE1-E349-43CD-BD16-EBC5B99B4255@oracle.com> Please review: JBS: https://bugs.openjdk.java.net/browse/JDK-8224052 Webrev: http://cr.openjdk.java.net/~hannesw/8224052/webrev.00/ This is based on Maurizio?s patch, which fixes signatures of instantiated generic methods in javadoc pages. What was missing was support for the @throws taglet, which happens to be the only javadoc taglet that actually displays type names. Unfortunately fixing @throws was rather involved. I first had to add getCurrentPageElement() methods in TagletWriter and HtmlDocletWriter to let taglets retrieve the current type element as suggested by Jon on the JBS issue. We then set up a map of type variables to their type substitutes. This seemed like the simplest way to go since there is no fixed correlation between the list of thrown types and @throws tags; tags may be missing, in no particular order etc. There was another problem in ThrowsTaglet where Utils.getFullyQualifiedName(Element) was used to keep track of already documented thrown types in ThrowsTaglet. However, this replaces type-variables with the name of the enclosing type, so thrown type vars were not tracked correctly and could be documented multiple times. This is fixed by using Utils.getFullyQualifiedName(Element, boolean) instead and passing false as second argument. Finally, as hinted by Jon on JBS, there was a bug where methods inherited from private intermediate classes where not documented. This is also fixed by accepting private types in Utils.isUndocumentedEnclosure(TypeElement). Another problem I found with methods inherited this way is that they are not included in the search index. I?ll file a new JBS issue for this. Hannes From jonathan.gibbons at oracle.com Wed Jan 15 19:03:06 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Wed, 15 Jan 2020 11:03:06 -0800 Subject: RFR: 8224052: Javadoc doesn't handle non-public intermediate types well In-Reply-To: <50D0BDE1-E349-43CD-BD16-EBC5B99B4255@oracle.com> References: <50D0BDE1-E349-43CD-BD16-EBC5B99B4255@oracle.com> Message-ID: <7db4aa26-341e-cdcd-0ba3-3be2111ad4ac@oracle.com> On 1/15/20 10:46 AM, Hannes Walln?fer wrote: > Finally, as hinted by Jon on JBS, there was a bug where methods inherited from private intermediate classes where not documented. This is also fixed by accepting private types in Utils.isUndocumentedEnclosure(TypeElement). I'm not sure this was a bug, just an unexpected behavior. We might need to investigate this one a bit more. -- Jon From jonathan.gibbons at oracle.com Wed Jan 15 23:47:45 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Wed, 15 Jan 2020 15:47:45 -0800 Subject: RFR: 8224052: Javadoc doesn't handle non-public intermediate types well In-Reply-To: <50D0BDE1-E349-43CD-BD16-EBC5B99B4255@oracle.com> References: <50D0BDE1-E349-43CD-BD16-EBC5B99B4255@oracle.com> Message-ID: <291e9da5-727b-dce5-0ade-8747bdbbb943@oracle.com> Approved. For subsequent followup, the following is a pre-existing condition and not new to your patch .... I wonder why alreadyDocumented is a Set ... would it not be better as a Set? I see it was declared as Set back in JDK 8 javadoc, so it may be that this is just "old code" that did not get properly modernized in the conversion to the new doclet. As regards package-private and private intermediate supertypes, in the absence of any pre-existing comment to the contrary, your inclusion of isPrivate in isUndocumentedEnclosure is morally justifiable, even if it is a change in behavior in an absurdly weird corner case that (to the best of my knowledge) is undocumented. -- Jon On 01/15/2020 10:46 AM, Hannes Walln?fer wrote: > Please review: > > JBS: https://bugs.openjdk.java.net/browse/JDK-8224052 > Webrev: http://cr.openjdk.java.net/~hannesw/8224052/webrev.00/ > > This is based on Maurizio?s patch, which fixes signatures of instantiated generic methods in javadoc pages. > > What was missing was support for the @throws taglet, which happens to be the only javadoc taglet that actually displays type names. Unfortunately fixing @throws was rather involved. I first had to add getCurrentPageElement() methods in TagletWriter and HtmlDocletWriter to let taglets retrieve the current type element as suggested by Jon on the JBS issue. We then set up a map of type variables to their type substitutes. This seemed like the simplest way to go since there is no fixed correlation between the list of thrown types and @throws tags; tags may be missing, in no particular order etc. > > There was another problem in ThrowsTaglet where Utils.getFullyQualifiedName(Element) was used to keep track of already documented thrown types in ThrowsTaglet. However, this replaces type-variables with the name of the enclosing type, so thrown type vars were not tracked correctly and could be documented multiple times. This is fixed by using Utils.getFullyQualifiedName(Element, boolean) instead and passing false as second argument. > > Finally, as hinted by Jon on JBS, there was a bug where methods inherited from private intermediate classes where not documented. This is also fixed by accepting private types in Utils.isUndocumentedEnclosure(TypeElement). > > Another problem I found with methods inherited this way is that they are not included in the search index. I?ll file a new JBS issue for this. > > Hannes From jonathan.gibbons at oracle.com Thu Jan 16 01:14:32 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Wed, 15 Jan 2020 17:14:32 -0800 Subject: RFR: 8224052: Javadoc doesn't handle non-public intermediate types well In-Reply-To: <291e9da5-727b-dce5-0ade-8747bdbbb943@oracle.com> References: <50D0BDE1-E349-43CD-BD16-EBC5B99B4255@oracle.com> <291e9da5-727b-dce5-0ade-8747bdbbb943@oracle.com> Message-ID: <6ad4b540-95ed-29d3-3eae-fd607ffc9d46@oracle.com> On 01/15/2020 03:47 PM, Jonathan Gibbons wrote: > > As regards package-private and private intermediate supertypes, in the > absence of any pre-existing comment to the contrary, your inclusion of > isPrivate in isUndocumentedEnclosure is morally justifiable, even if > it is a change in behavior in an absurdly weird corner case that (to > the best of my knowledge) is undocumented. As further justification for this change in behavior to be regarded as a bug fix, I note that javac allows access to public methods of private intermediate supertypes.? This implies the behavior is required by JLS, and so is justification for javadoc documenting the available methods. Toy files attached, for the record. -- Jon -------------- next part -------------- A non-text attachment was scrubbed... Name: Client.java Type: text/x-java Size: 148 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Demo.java Type: text/x-java Size: 341 bytes Desc: not available URL: From sundararajan.athijegannathan at oracle.com Thu Jan 16 03:03:07 2020 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Thu, 16 Jan 2020 08:33:07 +0530 Subject: RFR: 8224052: Javadoc doesn't handle non-public intermediate types well In-Reply-To: <50D0BDE1-E349-43CD-BD16-EBC5B99B4255@oracle.com> References: <50D0BDE1-E349-43CD-BD16-EBC5B99B4255@oracle.com> Message-ID: <7e09b4fa-831d-5a03-f963-b648ff66ef08@oracle.com> Not a review. Just a comment: New test code PrivateGenericParent.java misses copyright. -Sundar On 16/01/20 12:16 am, Hannes Walln?fer wrote: > Please review: > > JBS: https://bugs.openjdk.java.net/browse/JDK-8224052 > Webrev: http://cr.openjdk.java.net/~hannesw/8224052/webrev.00/ > > This is based on Maurizio?s patch, which fixes signatures of instantiated generic methods in javadoc pages. > > What was missing was support for the @throws taglet, which happens to be the only javadoc taglet that actually displays type names. Unfortunately fixing @throws was rather involved. I first had to add getCurrentPageElement() methods in TagletWriter and HtmlDocletWriter to let taglets retrieve the current type element as suggested by Jon on the JBS issue. We then set up a map of type variables to their type substitutes. This seemed like the simplest way to go since there is no fixed correlation between the list of thrown types and @throws tags; tags may be missing, in no particular order etc. > > There was another problem in ThrowsTaglet where Utils.getFullyQualifiedName(Element) was used to keep track of already documented thrown types in ThrowsTaglet. However, this replaces type-variables with the name of the enclosing type, so thrown type vars were not tracked correctly and could be documented multiple times. This is fixed by using Utils.getFullyQualifiedName(Element, boolean) instead and passing false as second argument. > > Finally, as hinted by Jon on JBS, there was a bug where methods inherited from private intermediate classes where not documented. This is also fixed by accepting private types in Utils.isUndocumentedEnclosure(TypeElement). > > Another problem I found with methods inherited this way is that they are not included in the search index. I?ll file a new JBS issue for this. > > Hannes From hannes.wallnoefer at oracle.com Thu Jan 16 13:42:32 2020 From: hannes.wallnoefer at oracle.com (=?utf-8?Q?Hannes_Walln=C3=B6fer?=) Date: Thu, 16 Jan 2020 14:42:32 +0100 Subject: RFR: 8224052: Javadoc doesn't handle non-public intermediate types well In-Reply-To: <6ad4b540-95ed-29d3-3eae-fd607ffc9d46@oracle.com> References: <50D0BDE1-E349-43CD-BD16-EBC5B99B4255@oracle.com> <291e9da5-727b-dce5-0ade-8747bdbbb943@oracle.com> <6ad4b540-95ed-29d3-3eae-fd607ffc9d46@oracle.com> Message-ID: Yes, the fact that this is allowed by javac was what lead me to include this in the patch. Unfortunately the webrev I sent was against JDK 15 instead of 14. I uploaded a new webrev for 14. Merging was straightforward and no changes were required for the code. Only test output had to be adapted to the old HTML anchor style. http://cr.openjdk.java.net/~hannesw/8224052/webrev.01/ This also adds the copyright header that was missing in the new test file as noted by Sundar. Hannes > Am 16.01.2020 um 02:14 schrieb Jonathan Gibbons : > > > > On 01/15/2020 03:47 PM, Jonathan Gibbons wrote: >> >> As regards package-private and private intermediate supertypes, in the absence of any pre-existing comment to the contrary, your inclusion of isPrivate in isUndocumentedEnclosure is morally justifiable, even if it is a change in behavior in an absurdly weird corner case that (to the best of my knowledge) is undocumented. > > As further justification for this change in behavior to be regarded as a bug fix, I note that javac allows access to public methods of private intermediate supertypes. This implies the behavior is required by JLS, and so is justification for javadoc documenting the available methods. > > Toy files attached, for the record. > > -- Jon > From jonathan.gibbons at oracle.com Thu Jan 16 18:37:28 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 16 Jan 2020 10:37:28 -0800 Subject: RFR: 8224052: Javadoc doesn't handle non-public intermediate types well In-Reply-To: References: <50D0BDE1-E349-43CD-BD16-EBC5B99B4255@oracle.com> <291e9da5-727b-dce5-0ade-8747bdbbb943@oracle.com> <6ad4b540-95ed-29d3-3eae-fd607ffc9d46@oracle.com> Message-ID: If you can get this in under the wire for 14, go for it. Otherwise, go for 15. -- Jon On 01/16/2020 05:42 AM, Hannes Walln?fer wrote: > Yes, the fact that this is allowed by javac was what lead me to include this in the patch. > > Unfortunately the webrev I sent was against JDK 15 instead of 14. I uploaded a new webrev for 14. Merging was straightforward and no changes were required for the code. Only test output had to be adapted to the old HTML anchor style. > > http://cr.openjdk.java.net/~hannesw/8224052/webrev.01/ > > This also adds the copyright header that was missing in the new test file as noted by Sundar. > > Hannes > > >> Am 16.01.2020 um 02:14 schrieb Jonathan Gibbons : >> >> >> >> On 01/15/2020 03:47 PM, Jonathan Gibbons wrote: >>> As regards package-private and private intermediate supertypes, in the absence of any pre-existing comment to the contrary, your inclusion of isPrivate in isUndocumentedEnclosure is morally justifiable, even if it is a change in behavior in an absurdly weird corner case that (to the best of my knowledge) is undocumented. >> As further justification for this change in behavior to be regarded as a bug fix, I note that javac allows access to public methods of private intermediate supertypes. This implies the behavior is required by JLS, and so is justification for javadoc documenting the available methods. >> >> Toy files attached, for the record. >> >> -- Jon >> From jonathan.gibbons at oracle.com Thu Jan 16 20:13:52 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 16 Jan 2020 12:13:52 -0800 Subject: RFR CSR: JDK-8237391 Add -Werror option to javadoc Message-ID: <33bc234f-09f6-379e-1bf9-ca40c00fb32c@oracle.com> Please review a simple CSR to have javadoc support a new option, -Werror, similar to the equivalent javac option. https://bugs.openjdk.java.net/browse/JDK-8237391 -- Jon From pavel.rappo at oracle.com Thu Jan 16 21:35:42 2020 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Thu, 16 Jan 2020 21:35:42 +0000 Subject: RFR [15] 8236700: Upgrading JSZip from v3.1.5 to v3.2.2 Message-ID: Hello, Please review the following change for https://bugs.openjdk.java.net/browse/JDK-8236700: http://cr.openjdk.java.net/~prappo/8236700/webrev.00/ This change upgrades the JSZip JavaScript library, used in Javadoc Search [1], to v3.22. I tested this change as follows. 1. Commented out lines 90 through 104 in src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js: // if (!moduleSearchIndex) { // createElem(doc, tag, 'module-search-index.js'); // } // if (!packageSearchIndex) { // createElem(doc, tag, 'package-search-index.js'); // } // if (!typeSearchIndex) { // createElem(doc, tag, 'type-search-index.js'); // } // if (!memberSearchIndex) { // createElem(doc, tag, 'member-search-index.js'); // } // if (!tagSearchIndex) { // createElem(doc, tag, 'tag-search-index.js'); // } This effectively makes *-search-index.js, the 5 non-zipped index files above, unavailable. So the search UI is forced to use the zipped files and, therefore, the JSZip library. 2. Built docs using `make docs` 3. Started a simple HTTP server in build/.../images/docs as there needs to be a web server to serve the zipped files, via HTTP requests, to the search UI. 4. Cleared the cache of the browser 5. Opened the main docs page, index.html, in the browser and verified that only the *-search-index.zip files were transferred. 6. Checked that the search UI produced the expected results for typical search terms such as list, thread, string, stream, etc. 7. Checked the same for a module, package, member, and tag search terms. This is to make sure that each of the 5 index files are accessed. Thanks, -Pavel -------------------------------------------------------------------------------- [1] https://bugs.openjdk.java.net/browse/JDK-8044243 From jonathan.gibbons at oracle.com Thu Jan 16 22:53:59 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 16 Jan 2020 14:53:59 -0800 Subject: RFR [15] 8236700: Upgrading JSZip from v3.1.5 to v3.2.2 In-Reply-To: References: Message-ID: +1 On 01/16/2020 01:35 PM, Pavel Rappo wrote: > Hello, > > Please review the following change for https://bugs.openjdk.java.net/browse/JDK-8236700: > > http://cr.openjdk.java.net/~prappo/8236700/webrev.00/ > > This change upgrades the JSZip JavaScript library, used in Javadoc Search [1], > to v3.22. I tested this change as follows. > > 1. Commented out lines 90 through 104 in > src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js: > > // if (!moduleSearchIndex) { > // createElem(doc, tag, 'module-search-index.js'); > // } > // if (!packageSearchIndex) { > // createElem(doc, tag, 'package-search-index.js'); > // } > // if (!typeSearchIndex) { > // createElem(doc, tag, 'type-search-index.js'); > // } > // if (!memberSearchIndex) { > // createElem(doc, tag, 'member-search-index.js'); > // } > // if (!tagSearchIndex) { > // createElem(doc, tag, 'tag-search-index.js'); > // } > > This effectively makes *-search-index.js, the 5 non-zipped index files above, > unavailable. So the search UI is forced to use the zipped files and, therefore, > the JSZip library. > 2. Built docs using `make docs` > 3. Started a simple HTTP server in build/.../images/docs as there needs to be a > web server to serve the zipped files, via HTTP requests, to the search UI. > 4. Cleared the cache of the browser > 5. Opened the main docs page, index.html, in the browser and verified that only > the *-search-index.zip files were transferred. > 6. Checked that the search UI produced the expected results for typical search > terms such as list, thread, string, stream, etc. > 7. Checked the same for a module, package, member, and tag search terms. > This is to make sure that each of the 5 index files are accessed. > > Thanks, > -Pavel > > -------------------------------------------------------------------------------- > [1] https://bugs.openjdk.java.net/browse/JDK-8044243 > From hannes.wallnoefer at oracle.com Fri Jan 17 12:00:58 2020 From: hannes.wallnoefer at oracle.com (=?utf-8?Q?Hannes_Walln=C3=B6fer?=) Date: Fri, 17 Jan 2020 13:00:58 +0100 Subject: RFR [15] 8236700: Upgrading JSZip from v3.1.5 to v3.2.2 In-Reply-To: References: Message-ID: <3F3DCD02-3006-4E1E-AB74-B24F778ABA05@oracle.com> Looks good. Thanks for the manual testing/checking. Hannes > Am 16.01.2020 um 22:35 schrieb Pavel Rappo : > > Hello, > > Please review the following change for https://bugs.openjdk.java.net/browse/JDK-8236700: > > http://cr.openjdk.java.net/~prappo/8236700/webrev.00/ > > This change upgrades the JSZip JavaScript library, used in Javadoc Search [1], > to v3.22. I tested this change as follows. > > 1. Commented out lines 90 through 104 in > src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js: > > // if (!moduleSearchIndex) { > // createElem(doc, tag, 'module-search-index.js'); > // } > // if (!packageSearchIndex) { > // createElem(doc, tag, 'package-search-index.js'); > // } > // if (!typeSearchIndex) { > // createElem(doc, tag, 'type-search-index.js'); > // } > // if (!memberSearchIndex) { > // createElem(doc, tag, 'member-search-index.js'); > // } > // if (!tagSearchIndex) { > // createElem(doc, tag, 'tag-search-index.js'); > // } > > This effectively makes *-search-index.js, the 5 non-zipped index files above, > unavailable. So the search UI is forced to use the zipped files and, therefore, > the JSZip library. > 2. Built docs using `make docs` > 3. Started a simple HTTP server in build/.../images/docs as there needs to be a > web server to serve the zipped files, via HTTP requests, to the search UI. > 4. Cleared the cache of the browser > 5. Opened the main docs page, index.html, in the browser and verified that only > the *-search-index.zip files were transferred. > 6. Checked that the search UI produced the expected results for typical search > terms such as list, thread, string, stream, etc. > 7. Checked the same for a module, package, member, and tag search terms. > This is to make sure that each of the 5 index files are accessed. > > Thanks, > -Pavel > > -------------------------------------------------------------------------------- > [1] https://bugs.openjdk.java.net/browse/JDK-8044243 > From pavel.rappo at oracle.com Fri Jan 17 13:57:12 2020 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Fri, 17 Jan 2020 13:57:12 +0000 Subject: RFR CSR: JDK-8237391 Add -Werror option to javadoc In-Reply-To: <33bc234f-09f6-379e-1bf9-ca40c00fb32c@oracle.com> References: <33bc234f-09f6-379e-1bf9-ca40c00fb32c@oracle.com> Message-ID: I like it. When comparing the wording for the corresponding option for javac I noticed that it is more vague than that of the proposed for javadoc: -Werror Terminate compilation if warnings occur (javac) -Werror: treat warnings as if they were errors (proposed for javadoc) Does the latter preclude lazy behaviour (i.e. the documenting process terminates immediately after the first warning occurs)? It might not be a big deal, especially taking into account that javadoc doesn't have options such as: -Xmaxerrors number Set the maximum number of errors to print. -Xmaxwarns number Set the maximum number of warnings to print. -Pavel > On 16 Jan 2020, at 20:13, Jonathan Gibbons wrote: > > Please review a simple CSR to have javadoc support a new option, -Werror, similar to the equivalent javac option. > > https://bugs.openjdk.java.net/browse/JDK-8237391 > > -- Jon > From jonathan.gibbons at oracle.com Fri Jan 17 18:25:03 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Fri, 17 Jan 2020 10:25:03 -0800 Subject: RFR CSR: JDK-8237391 Add -Werror option to javadoc In-Reply-To: References: <33bc234f-09f6-379e-1bf9-ca40c00fb32c@oracle.com> Message-ID: Hi Pavel, Good feedback. The javadoc wording was deliberately more vague, because I couldn't think of anything accurate and more specific to say. Essentially, we just want to convey/enable one bit of info ... you'll get a non-zero exit code if any warnings occur. The "terminate early" barely applies to javadoc, since we don't have the same concept of phases as javac. That being said, there is ... * Option decoding * Read files (using javac) * Another other prep in the tool before handing control to the doclet * The doclet ?The other reason was because I couldn't think of a good word to replace "compilation".?? Any suggestions? The proposed javadoc text does not preclude lazy behavior; it delegates to the general rules for errors, for which nothing is specified(!) although it is common practice to terminate work "sometime after" the diagnostic occurs. Normally, javac continues to the end of the current phase, since the check of "should I continue" is done between phases. Note that javadoc *does* have -Xmaxerrs and -Xmaxwarns, and (surprisingly?) they are actually in alignment with javac! > jjg at jjg-Precision-T7600:/w/jjg/work/jdk.ref$ > ./build/linux-x86_64-server-release/images/jdk/bin/javac -X | grep max > ? -Xmaxerrs ?????????? Set the maximum number of errors to print > ? -Xmaxwarns ????????? Set the maximum number of warnings to print > jjg at jjg-Precision-T7600:/w/jjg/work/jdk.ref$ > ./build/linux-x86_64-server-release/images/jdk/bin/javadoc -X | grep max > ??? -Xmaxerrs > ????????????????? Set the maximum number of errors to print > ??? -Xmaxwarns > ????????????????? Set the maximum number of warnings to print -- Jon On 01/17/2020 05:57 AM, Pavel Rappo wrote: > I like it. > > When comparing the wording for the corresponding option for javac I noticed that > it is more vague than that of the proposed for javadoc: > > -Werror Terminate compilation if warnings occur (javac) > -Werror: treat warnings as if they were errors (proposed for javadoc) > > Does the latter preclude lazy behaviour (i.e. the documenting process terminates > immediately after the first warning occurs)? > > It might not be a big deal, especially taking into account that javadoc doesn't > have options such as: > > -Xmaxerrors number > Set the maximum number of errors to print. > > -Xmaxwarns number > Set the maximum number of warnings to print. > > -Pavel > >> On 16 Jan 2020, at 20:13, Jonathan Gibbons wrote: >> >> Please review a simple CSR to have javadoc support a new option, -Werror, similar to the equivalent javac option. >> >> https://bugs.openjdk.java.net/browse/JDK-8237391 >> >> -- Jon >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From pavel.rappo at oracle.com Fri Jan 17 19:04:39 2020 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Fri, 17 Jan 2020 19:04:39 +0000 Subject: RFR CSR: JDK-8237391 Add -Werror option to javadoc In-Reply-To: References: <33bc234f-09f6-379e-1bf9-ca40c00fb32c@oracle.com> Message-ID: <2F2FB873-D106-4B86-A048-A9FABA23A524@oracle.com> Hi Jon, > On 17 Jan 2020, at 18:25, Jonathan Gibbons wrote: > > Hi Pavel, > > Good feedback. > > The javadoc wording was deliberately more vague, because I couldn't think of anything accurate and more specific to say. Essentially, we just want to convey/enable one bit of info ... you'll get a non-zero exit code if any warnings occur. I thought that javac's wording was more vague. The intent is clear though. > > > The other reason was because I couldn't think of a good word to replace "compilation". Any suggestions? Could (compilation, compiling) map to (documentation, documenting)? https://www.merriam-webster.com/dictionary/documentation 1: the act or an instance of furnishing or authenticating with documents https://www.merriam-webster.com/dictionary/documenting > The proposed javadoc text does not preclude lazy behavior; it delegates to the general rules for errors, for which nothing is specified(!) although it is common practice to terminate work "sometime after" the diagnostic occurs. Normally, javac continues to the end of the current phase, since the check of "should I continue" is done between phases. ok. > Note that javadoc *does* have -Xmaxerrs and -Xmaxwarns, and (surprisingly?) they are actually in alignment with javac! Dang! I missed that. Perhaps because I was looking at (sadly, outdated) man pages, rather than the output of `%tool-name% -X`. In contrast to javadoc's man page, javac's does provide info about those options. -Pavel From jonathan.gibbons at oracle.com Sat Jan 18 01:51:24 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Fri, 17 Jan 2020 17:51:24 -0800 Subject: RFR: [15] JDK-8237492 Reorganize impl of doclet options Message-ID: <842d95f8-a31d-b1cd-34f3-f11e924c78cb@oracle.com> Please review a code-cleanup to reorganize the code to handle doclet options. Fundamentally, the change is to move the methods and fields to handle option processing from BaseConfiguration and HtmlConfiguration out into new abstractions BaseOptions and HtmlOptions.? As such, the dominant changes are to these 4 files. The impact on the rest of the doclet code is just to change where to access the values for options: instead of accessing the values directly from the *Configuration classes, the values are now obtained from the corresponding *Option classes, which are in turn accessed from the *Configuration classes. The reference to the Options objects are typically cached when there are a large number of usages in the code. In a? number of cases, the cache is in a supertype, which reduces the visible churn. I've taken this opportunity to rename the fields for the values of options into the standard camelCase convention. And, I've done some basic work to clean up comments, although more could be done (later). Fixing a bunch of spurious warnings uncoverable a real warning, that the code was creating a sorted set of incomparable Option objects. This changeset also fixes that issue, which mostly just shows up in the signatures for internal collections of option objects. There is no change in functionality here. All the tests pass without change, except for one that was tunneling into an impl class, and which needed to be updated. There's probably a similar cleanup coming to the code to handle tool options. -- Jon JBS: https://bugs.openjdk.java.net/browse/JDK-8237492 Webrev: http://cr.openjdk.java.net/~jjg/8237492/webrev/ From christoph.langer at sap.com Sat Jan 18 05:58:27 2020 From: christoph.langer at sap.com (Langer, Christoph) Date: Sat, 18 Jan 2020 05:58:27 +0000 Subject: RFR [15] 8236700: Upgrading JSZip from v3.1.5 to v3.2.2 In-Reply-To: <3F3DCD02-3006-4E1E-AB74-B24F778ABA05@oracle.com> References: <3F3DCD02-3006-4E1E-AB74-B24F778ABA05@oracle.com> Message-ID: Hi, I've just seen, that the bug https://bugs.openjdk.java.net/browse/JDK-8236700 is closed. Is it possible to open it up? Thanks Christoph > -----Original Message----- > From: javadoc-dev On Behalf Of > Hannes Walln?fer > Sent: Freitag, 17. Januar 2020 13:01 > To: Pavel Rappo > Cc: javadoc-dev > Subject: Re: RFR [15] 8236700: Upgrading JSZip from v3.1.5 to v3.2.2 > > Looks good. Thanks for the manual testing/checking. > > Hannes > > > Am 16.01.2020 um 22:35 schrieb Pavel Rappo : > > > > Hello, > > > > Please review the following change for > https://bugs.openjdk.java.net/browse/JDK-8236700: > > > > http://cr.openjdk.java.net/~prappo/8236700/webrev.00/ > > > > This change upgrades the JSZip JavaScript library, used in Javadoc Search > [1], > > to v3.22. I tested this change as follows. > > > > 1. Commented out lines 90 through 104 in > > > src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resource > s/script.js: > > > > // if (!moduleSearchIndex) { > > // createElem(doc, tag, 'module-search-index.js'); > > // } > > // if (!packageSearchIndex) { > > // createElem(doc, tag, 'package-search-index.js'); > > // } > > // if (!typeSearchIndex) { > > // createElem(doc, tag, 'type-search-index.js'); > > // } > > // if (!memberSearchIndex) { > > // createElem(doc, tag, 'member-search-index.js'); > > // } > > // if (!tagSearchIndex) { > > // createElem(doc, tag, 'tag-search-index.js'); > > // } > > > > This effectively makes *-search-index.js, the 5 non-zipped index files > above, > > unavailable. So the search UI is forced to use the zipped files and, > therefore, > > the JSZip library. > > 2. Built docs using `make docs` > > 3. Started a simple HTTP server in build/.../images/docs as there needs to > be a > > web server to serve the zipped files, via HTTP requests, to the search UI. > > 4. Cleared the cache of the browser > > 5. Opened the main docs page, index.html, in the browser and verified that > only > > the *-search-index.zip files were transferred. > > 6. Checked that the search UI produced the expected results for typical > search > > terms such as list, thread, string, stream, etc. > > 7. Checked the same for a module, package, member, and tag search > terms. > > This is to make sure that each of the 5 index files are accessed. > > > > Thanks, > > -Pavel > > > > -------------------------------------------------------------------------------- > > [1] https://bugs.openjdk.java.net/browse/JDK-8044243 > > From pavel.rappo at oracle.com Tue Jan 21 12:24:35 2020 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Tue, 21 Jan 2020 12:24:35 +0000 Subject: RFR: [15] JDK-8237492 Reorganize impl of doclet options In-Reply-To: <842d95f8-a31d-b1cd-34f3-f11e924c78cb@oracle.com> References: <842d95f8-a31d-b1cd-34f3-f11e924c78cb@oracle.com> Message-ID: Jon, I don't have a strong opinion on this refactoring. I will rely on your judgment and the fact that you know that code well. My initial reaction was "Isn't it violating the Law of Demeter or something?" But on a closer look, I understood that it was merely a restructuring action. What you seem to be doing is trying to compartmentalize that code better. This refactoring preserves the collocation that exists between the code that parses the properties and the code that provides these properties for internal consumption. 1. You have reintroduced a forgotten bounded wildcard to public Set getSupportedOptions() Good. Compatibility-wise this should be benign. Hopefully, no one tries to put anything into that set, which should be assumed unmodifiable anyway. 2. You consistently used camelCase naming for fields that represent options. This effectively "unlinks" them from their command-line names, which is not bad. Fewer possibilities to mess this during (automated) future refactorings if you ask me. 3. I'm not sure what can be done about that TreeSet on HtmlOptions.java:458. Statically it operates on a non-comparable type, Doclet.Option. 4. What is the purpose of the BaseOptions.getOptions() method? 5. HtmlConfiguration:170 feels like a debugging leftover. I'm not sure that this condition is even possible. Could it be an `assert` instead? 6. AbstractMemberWriter's fields `printedSummaryHeader` and `nodepr` seem not to be used. Can those be deleted? 7. AbstractMemberWriter.java: 385, 603. Those could use the internal (alias) field `options`. 8. I noticed that BaseConfiguration have many blank lines. Was it done on purpose? 9. Should BaseOptions use 2020 as the second copyright year? While we are in this area, consider hyphenating "command line" where it is a compound adjective rather than a noun (possibly, not an exhaustive list): * HtmlConfiguration: 54, 56 * HtmlOptions: 68, 74, 87, 125, 132, 138, 144, 162 * BaseConfiguration: 396, 693 * BaseOptions: 178 * IllegalOptionValue: 32 * Main: 49, 58, 70, 83 * javadoc.properties: 94 -Pavel P.S. Thanks for being super careful and not only updating the javadoc comments but also the commented out code in SourceToHTMLConverter! > On 18 Jan 2020, at 01:51, Jonathan Gibbons wrote: > > Please review a code-cleanup to reorganize the code to handle doclet options. > > Fundamentally, the change is to move the methods and fields to handle option processing from BaseConfiguration and HtmlConfiguration out into new abstractions BaseOptions and HtmlOptions. As such, the dominant changes are to these 4 files. > > The impact on the rest of the doclet code is just to change where to access the values for options: instead of accessing the values directly from the *Configuration classes, the values are now obtained from the corresponding *Option classes, which are in turn accessed from the *Configuration classes. The reference to the Options objects are typically cached when there are a large number of usages in the code. In a number of cases, the cache is in a supertype, which reduces the visible churn. > > I've taken this opportunity to rename the fields for the values of options into the standard camelCase convention. And, I've done some basic work to clean up comments, although more could be done (later). > > Fixing a bunch of spurious warnings uncoverable a real warning, that the code was creating a sorted set of incomparable Option objects. This changeset also fixes that issue, which mostly just shows up in the signatures for internal collections of option objects. > > There is no change in functionality here. All the tests pass without change, except for one that was tunneling into an impl class, and which needed to be updated. > > There's probably a similar cleanup coming to the code to handle tool options. > > -- Jon > > > JBS: https://bugs.openjdk.java.net/browse/JDK-8237492 > Webrev: http://cr.openjdk.java.net/~jjg/8237492/webrev/ > > > From jonathan.gibbons at oracle.com Tue Jan 21 15:15:33 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 21 Jan 2020 07:15:33 -0800 Subject: RFR: [15] JDK-8237492 Reorganize impl of doclet options In-Reply-To: References: <842d95f8-a31d-b1cd-34f3-f11e924c78cb@oracle.com> Message-ID: <6bb151f4-74ba-c3ef-fd1d-59d3eaef5a53@oracle.com> Pavel, Thanks for the detailed comments. I'll go through the list and respond in detail when I have the code and review in front of me. I also have in mind some more detailed class-level doc comments for BaseOptions and HtmlOptions classes that I will put in the next round. -- Jon On 1/21/20 4:24 AM, Pavel Rappo wrote: > Jon, > > I don't have a strong opinion on this refactoring. I will rely on your judgment > and the fact that you know that code well. > > My initial reaction was "Isn't it violating the Law of Demeter or something?" > But on a closer look, I understood that it was merely a restructuring action. > What you seem to be doing is trying to compartmentalize that code better. > > This refactoring preserves the collocation that exists between the code that > parses the properties and the code that provides these properties for internal > consumption. > > 1. You have reintroduced a forgotten bounded wildcard to > > public Set getSupportedOptions() > > Good. Compatibility-wise this should be benign. Hopefully, no one tries to put > anything into that set, which should be assumed unmodifiable anyway. > > 2. You consistently used camelCase naming for fields that represent options. > This effectively "unlinks" them from their command-line names, which is not bad. > Fewer possibilities to mess this during (automated) future refactorings if you > ask me. > > 3. I'm not sure what can be done about that TreeSet on HtmlOptions.java:458. > Statically it operates on a non-comparable type, Doclet.Option. > > 4. What is the purpose of the BaseOptions.getOptions() method? > > 5. HtmlConfiguration:170 feels like a debugging leftover. I'm not sure that > this condition is even possible. Could it be an `assert` instead? > > 6. AbstractMemberWriter's fields `printedSummaryHeader` and `nodepr` seem not to > be used. Can those be deleted? > > 7. AbstractMemberWriter.java: 385, 603. Those could use the internal (alias) > field `options`. > > 8. I noticed that BaseConfiguration have many blank lines. Was it done on purpose? > > 9. Should BaseOptions use 2020 as the second copyright year? > > While we are in this area, consider hyphenating "command line" where it is a > compound adjective rather than a noun (possibly, not an exhaustive list): > > * HtmlConfiguration: 54, 56 > * HtmlOptions: 68, 74, 87, 125, 132, 138, 144, 162 > * BaseConfiguration: 396, 693 > * BaseOptions: 178 > * IllegalOptionValue: 32 > * Main: 49, 58, 70, 83 > * javadoc.properties: 94 > > -Pavel > > P.S. Thanks for being super careful and not only updating the javadoc comments > but also the commented out code in SourceToHTMLConverter! > >> On 18 Jan 2020, at 01:51, Jonathan Gibbons wrote: >> >> Please review a code-cleanup to reorganize the code to handle doclet options. >> >> Fundamentally, the change is to move the methods and fields to handle option processing from BaseConfiguration and HtmlConfiguration out into new abstractions BaseOptions and HtmlOptions. As such, the dominant changes are to these 4 files. >> >> The impact on the rest of the doclet code is just to change where to access the values for options: instead of accessing the values directly from the *Configuration classes, the values are now obtained from the corresponding *Option classes, which are in turn accessed from the *Configuration classes. The reference to the Options objects are typically cached when there are a large number of usages in the code. In a number of cases, the cache is in a supertype, which reduces the visible churn. >> >> I've taken this opportunity to rename the fields for the values of options into the standard camelCase convention. And, I've done some basic work to clean up comments, although more could be done (later). >> >> Fixing a bunch of spurious warnings uncoverable a real warning, that the code was creating a sorted set of incomparable Option objects. This changeset also fixes that issue, which mostly just shows up in the signatures for internal collections of option objects. >> >> There is no change in functionality here. All the tests pass without change, except for one that was tunneling into an impl class, and which needed to be updated. >> >> There's probably a similar cleanup coming to the code to handle tool options. >> >> -- Jon >> >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8237492 >> Webrev: http://cr.openjdk.java.net/~jjg/8237492/webrev/ >> >> >> From jonathan.gibbons at oracle.com Tue Jan 21 15:26:36 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 21 Jan 2020 07:26:36 -0800 Subject: RFR [15] 8236700: Upgrading JSZip from v3.1.5 to v3.2.2 In-Reply-To: References: <3F3DCD02-3006-4E1E-AB74-B24F778ABA05@oracle.com> Message-ID: <82c819ba-4504-a6e9-7728-4b4cac63b9bc@oracle.com> Christoph, Thanks for asking.? It would have been better for this to have been filed as a non-Confidential issue in the first place. I realize you are probably asking for the purpose of backporting the update. Would it work to create a non-Confidential "shadow" issue that duplicates the original, that can be used in a backport? -- Jon On 1/17/20 9:58 PM, Langer, Christoph wrote: > Hi, > > I've just seen, that the bug https://bugs.openjdk.java.net/browse/JDK-8236700 is closed. Is it possible to open it up? > > Thanks > Christoph > >> -----Original Message----- >> From: javadoc-dev On Behalf Of >> Hannes Walln?fer >> Sent: Freitag, 17. Januar 2020 13:01 >> To: Pavel Rappo >> Cc: javadoc-dev >> Subject: Re: RFR [15] 8236700: Upgrading JSZip from v3.1.5 to v3.2.2 >> >> Looks good. Thanks for the manual testing/checking. >> >> Hannes >> >>> Am 16.01.2020 um 22:35 schrieb Pavel Rappo : >>> >>> Hello, >>> >>> Please review the following change for >> https://bugs.openjdk.java.net/browse/JDK-8236700: >>> http://cr.openjdk.java.net/~prappo/8236700/webrev.00/ >>> >>> This change upgrades the JSZip JavaScript library, used in Javadoc Search >> [1], >>> to v3.22. I tested this change as follows. >>> >>> 1. Commented out lines 90 through 104 in >>> >> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resource >> s/script.js: >>> // if (!moduleSearchIndex) { >>> // createElem(doc, tag, 'module-search-index.js'); >>> // } >>> // if (!packageSearchIndex) { >>> // createElem(doc, tag, 'package-search-index.js'); >>> // } >>> // if (!typeSearchIndex) { >>> // createElem(doc, tag, 'type-search-index.js'); >>> // } >>> // if (!memberSearchIndex) { >>> // createElem(doc, tag, 'member-search-index.js'); >>> // } >>> // if (!tagSearchIndex) { >>> // createElem(doc, tag, 'tag-search-index.js'); >>> // } >>> >>> This effectively makes *-search-index.js, the 5 non-zipped index files >> above, >>> unavailable. So the search UI is forced to use the zipped files and, >> therefore, >>> the JSZip library. >>> 2. Built docs using `make docs` >>> 3. Started a simple HTTP server in build/.../images/docs as there needs to >> be a >>> web server to serve the zipped files, via HTTP requests, to the search UI. >>> 4. Cleared the cache of the browser >>> 5. Opened the main docs page, index.html, in the browser and verified that >> only >>> the *-search-index.zip files were transferred. >>> 6. Checked that the search UI produced the expected results for typical >> search >>> terms such as list, thread, string, stream, etc. >>> 7. Checked the same for a module, package, member, and tag search >> terms. >>> This is to make sure that each of the 5 index files are accessed. >>> >>> Thanks, >>> -Pavel >>> >>> -------------------------------------------------------------------------------- >>> [1] https://bugs.openjdk.java.net/browse/JDK-8044243 >>> From christoph.langer at sap.com Tue Jan 21 15:40:08 2020 From: christoph.langer at sap.com (Langer, Christoph) Date: Tue, 21 Jan 2020 15:40:08 +0000 Subject: RFR [15] 8236700: Upgrading JSZip from v3.1.5 to v3.2.2 In-Reply-To: <82c819ba-4504-a6e9-7728-4b4cac63b9bc@oracle.com> References: <3F3DCD02-3006-4E1E-AB74-B24F778ABA05@oracle.com> <82c819ba-4504-a6e9-7728-4b4cac63b9bc@oracle.com> Message-ID: Hi Jon, thanks for getting back to me on that one. You're right, it's about backporting. The problem with closed bugs is, if Oracle backports such an item, the backport would probably be marked confidential by default as well. So OpenJDK wouldn't see the backport and we would miss it. So I fear the only help for us would be if you can open up the bug. Or you can somehow make sure that potential backport items for this become public. Thanks Christoph > -----Original Message----- > From: Jonathan Gibbons > Sent: Dienstag, 21. Januar 2020 16:27 > To: Langer, Christoph ; Hannes Walln?fer > ; Pavel Rappo > Cc: javadoc-dev > Subject: Re: RFR [15] 8236700: Upgrading JSZip from v3.1.5 to v3.2.2 > > Christoph, > > Thanks for asking.? It would have been better for this to have been > filed as a non-Confidential issue in the first place. > > I realize you are probably asking for the purpose of backporting the > update. Would it work to create a non-Confidential "shadow" issue that > duplicates the original, that can be used in a backport? > > -- Jon > > On 1/17/20 9:58 PM, Langer, Christoph wrote: > > Hi, > > > > I've just seen, that the bug https://bugs.openjdk.java.net/browse/JDK- > 8236700 is closed. Is it possible to open it up? > > > > Thanks > > Christoph > > > >> -----Original Message----- > >> From: javadoc-dev On Behalf > Of > >> Hannes Walln?fer > >> Sent: Freitag, 17. Januar 2020 13:01 > >> To: Pavel Rappo > >> Cc: javadoc-dev > >> Subject: Re: RFR [15] 8236700: Upgrading JSZip from v3.1.5 to v3.2.2 > >> > >> Looks good. Thanks for the manual testing/checking. > >> > >> Hannes > >> > >>> Am 16.01.2020 um 22:35 schrieb Pavel Rappo > : > >>> > >>> Hello, > >>> > >>> Please review the following change for > >> https://bugs.openjdk.java.net/browse/JDK-8236700: > >>> http://cr.openjdk.java.net/~prappo/8236700/webrev.00/ > >>> > >>> This change upgrades the JSZip JavaScript library, used in Javadoc Search > >> [1], > >>> to v3.22. I tested this change as follows. > >>> > >>> 1. Commented out lines 90 through 104 in > >>> > >> > src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resource > >> s/script.js: > >>> // if (!moduleSearchIndex) { > >>> // createElem(doc, tag, 'module-search-index.js'); > >>> // } > >>> // if (!packageSearchIndex) { > >>> // createElem(doc, tag, 'package-search-index.js'); > >>> // } > >>> // if (!typeSearchIndex) { > >>> // createElem(doc, tag, 'type-search-index.js'); > >>> // } > >>> // if (!memberSearchIndex) { > >>> // createElem(doc, tag, 'member-search-index.js'); > >>> // } > >>> // if (!tagSearchIndex) { > >>> // createElem(doc, tag, 'tag-search-index.js'); > >>> // } > >>> > >>> This effectively makes *-search-index.js, the 5 non-zipped index files > >> above, > >>> unavailable. So the search UI is forced to use the zipped files and, > >> therefore, > >>> the JSZip library. > >>> 2. Built docs using `make docs` > >>> 3. Started a simple HTTP server in build/.../images/docs as there needs > to > >> be a > >>> web server to serve the zipped files, via HTTP requests, to the search UI. > >>> 4. Cleared the cache of the browser > >>> 5. Opened the main docs page, index.html, in the browser and verified > that > >> only > >>> the *-search-index.zip files were transferred. > >>> 6. Checked that the search UI produced the expected results for typical > >> search > >>> terms such as list, thread, string, stream, etc. > >>> 7. Checked the same for a module, package, member, and tag search > >> terms. > >>> This is to make sure that each of the 5 index files are accessed. > >>> > >>> Thanks, > >>> -Pavel > >>> > >>> -------------------------------------------------------------------------------- > >>> [1] https://bugs.openjdk.java.net/browse/JDK-8044243 > >>> From jonathan.gibbons at oracle.com Tue Jan 21 18:55:44 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 21 Jan 2020 10:55:44 -0800 Subject: RFR: [15] JDK-8237492 Reorganize impl of doclet options In-Reply-To: References: <842d95f8-a31d-b1cd-34f3-f11e924c78cb@oracle.com> Message-ID: <6eb4768a-d1aa-9137-a30b-d4459fbd4eba@oracle.com> Pavel, All great feedback, and all points addressed, as described in the details inline below. New webrev, addresses all your comments, adds a couple of class-level doc comments to the two new classes, and fixes a couple of inconsequential spelling errors. Otherwise, no changes in all the other affected files. http://cr.openjdk.java.net/~jjg/8237492/webrev.01/ -- Jon On 1/21/20 4:24 AM, Pavel Rappo wrote: > Jon, > > I don't have a strong opinion on this refactoring. I will rely on your judgment > and the fact that you know that code well. I know it "well enough". While it would have been possible to do this cleanup when we converted to the new doclet, a significant factor at that time was to minimize cleanup like this, in order to make it easier to review the old and new code side by side.? With some potential (minor) functional improvements coming for the command-line options, this seems like a good opportunity to clean up this code. > > My initial reaction was "Isn't it violating the Law of Demeter or something?" > But on a closer look, I understood that it was merely a restructuring action. > What you seem to be doing is trying to compartmentalize that code better. Yes, the intent is to improve our acknowledgement of the Law of Demeter! The ongoing task is to draw lines around parts of the hodge-podge that is {Base,Html}Configuration, and to pull out those parts into separate, better defined abstractions. Another potential cleanup, for another day, is to separate out the search index tables, and any strongly related methods, from HtmlConfiguration into another separate new abstraction. > > This refactoring preserves the collocation that exists between the code that > parses the properties and the code that provides these properties for internal > consumption. > > 1. You have reintroduced a forgotten bounded wildcard to > > public Set getSupportedOptions() > > Good. Compatibility-wise this should be benign. Hopefully, no one tries to put > anything into that set, which should be assumed unmodifiable anyway. It's only an internal API, and we control the implementations. As they say, "No public API was affected in the making of this changeset." I changed to address an issue you make later on ... about a TreeSet containing non-comparable objects. More on that later on. > > 2. You consistently used camelCase naming for fields that represent options. > This effectively "unlinks" them from their command-line names, which is not bad. > Fewer possibilities to mess this during (automated) future refactorings if you > ask me. The option names are often horrible and do not provide a really good precedent. It's tempting to an an informational source-only annotation that identifies the options that affect each field, but without any checking, such annotations would be little better than comments ... which is why I added comments to identify the options for each value. > > 3. I'm not sure what can be done about that TreeSet on HtmlOptions.java:458. > Statically it operates on a non-comparable type, Doclet.Option. Good catch; now fixed. This was the reason I fixed the wildcard you mentioned earlier.? The intent is that the TreeSet was for BaseOptions.Option, which *are* comparable. I did not go back and complete the signature edits. > > 4. What is the purpose of the BaseOptions.getOptions() method? Another good catch. I thought it would be necessary, to allow the provision of a covariant override in HtmlOptions, but that logic is flawed, since to make use of the covariant override, you'd have to have an HtmlOptions object in the first place. > > 5. HtmlConfiguration:170 feels like a debugging leftover. I'm not sure that > this condition is even possible. Could it be an `assert` instead? My bad; it was a debugging leftover. The condition can arise while in the process of constructing the BaseOptions supertype of an HtmlOptions object. > > 6. AbstractMemberWriter's fields `printedSummaryHeader` and `nodepr` seem not to > be used. Can those be deleted? Deleted > > 7. AbstractMemberWriter.java: 385, 603. Those could use the internal (alias) > field `options`. Yes, while editing the code, by itself, it did not seem worthwhile having AbstractMemberWriter provide an alias, for just those two instances you mention ... but it later became useful to provide the alias for the subtypes of AbstractMemberWriter. > > 8. I noticed that BaseConfiguration have many blank lines. Was it done on purpose? IDE leftovers, from moving content to the new classes. Excessive blank lines removed. > > 9. Should BaseOptions use 2020 as the second copyright year? I generally update copyrights after a review and before a push, to avoid spurious changes showing up in the review. But since you have mentioned it, I will fix the new files. > > While we are in this area, consider hyphenating "command line" where it is a > compound adjective rather than a noun (possibly, not an exhaustive list): > > * HtmlConfiguration: 54, 56 > * HtmlOptions: 68, 74, 87, 125, 132, 138, 144, 162 > * BaseConfiguration: 396, 693 > * BaseOptions: 178 > * IllegalOptionValue: 32 > * Main: 49, 58, 70, 83 > * javadoc.properties: 94 I fixed all instances found by searching for "command line opt" > > -Pavel > > P.S. Thanks for being super careful and not only updating the javadoc comments > but also the commented out code in SourceToHTMLConverter! > >> On 18 Jan 2020, at 01:51, Jonathan Gibbons wrote: >> >> Please review a code-cleanup to reorganize the code to handle doclet options. >> >> Fundamentally, the change is to move the methods and fields to handle option processing from BaseConfiguration and HtmlConfiguration out into new abstractions BaseOptions and HtmlOptions. As such, the dominant changes are to these 4 files. >> >> The impact on the rest of the doclet code is just to change where to access the values for options: instead of accessing the values directly from the *Configuration classes, the values are now obtained from the corresponding *Option classes, which are in turn accessed from the *Configuration classes. The reference to the Options objects are typically cached when there are a large number of usages in the code. In a number of cases, the cache is in a supertype, which reduces the visible churn. >> >> I've taken this opportunity to rename the fields for the values of options into the standard camelCase convention. And, I've done some basic work to clean up comments, although more could be done (later). >> >> Fixing a bunch of spurious warnings uncoverable a real warning, that the code was creating a sorted set of incomparable Option objects. This changeset also fixes that issue, which mostly just shows up in the signatures for internal collections of option objects. >> >> There is no change in functionality here. All the tests pass without change, except for one that was tunneling into an impl class, and which needed to be updated. >> >> There's probably a similar cleanup coming to the code to handle tool options. >> >> -- Jon >> >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8237492 >> Webrev: http://cr.openjdk.java.net/~jjg/8237492/webrev/ >> >> >> From jonathan.gibbons at oracle.com Tue Jan 21 21:18:21 2020 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 21 Jan 2020 13:18:21 -0800 Subject: RFR: JDK-8237597 Fix typography in comments for Doclet.Option.Kind Message-ID: Please review a tiny changeset (inline below) to fix the typography in some short javadoc comments. No semantic changes, so no CSR. -- Jon JBS: https://bugs.openjdk.java.net/browse/JDK-8237597 diff -r afedfc27878c src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Doclet.java --- a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Doclet.java Tue Jan 21 18:38:46 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Doclet.java Tue Jan 21 13:09:24 2020 -0800 @@ -154,11 +154,11 @@ ????????? * The kind of an option. ????????? */ ???????? enum Kind { -??????????? /** an extended option, such as those prefixed with -X */ +??????????? /** An extended option, such as those prefixed with {@code -X}. */ ???????????? EXTENDED, -??????????? /** a standard option */ +??????????? /** A standard option. */ ???????????? STANDARD, -??????????? /** an implementation reserved option */ +??????????? /** An implementation-reserved option. */ ???????????? OTHER; ???????? } ???? } From pavel.rappo at oracle.com Tue Jan 21 22:14:04 2020 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Tue, 21 Jan 2020 22:14:04 +0000 Subject: RFR: JDK-8237597 Fix typography in comments for Doclet.Option.Kind In-Reply-To: References: Message-ID: Looks good. > On 21 Jan 2020, at 21:18, Jonathan Gibbons wrote: > > ?Please review a tiny changeset (inline below) to fix the typography in some short javadoc comments. > > No semantic changes, so no CSR. > > -- Jon > > JBS: https://bugs.openjdk.java.net/browse/JDK-8237597 > > > diff -r afedfc27878c src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Doclet.java > --- a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Doclet.java Tue Jan 21 18:38:46 2020 +0000 > +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Doclet.java Tue Jan 21 13:09:24 2020 -0800 > @@ -154,11 +154,11 @@ > * The kind of an option. > */ > enum Kind { > - /** an extended option, such as those prefixed with -X */ > + /** An extended option, such as those prefixed with {@code -X}. */ > EXTENDED, > - /** a standard option */ > + /** A standard option. */ > STANDARD, > - /** an implementation reserved option */ > + /** An implementation-reserved option. */ > OTHER; > } > } > > > From pavel.rappo at oracle.com Wed Jan 22 11:58:09 2020 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Wed, 22 Jan 2020 11:58:09 +0000 Subject: RFR [15] 8233795: Consider adding a notion of a Value-based class to API Documentation index Message-ID: <553EA827-AFC7-432B-BB3B-125277E33CEE@oracle.com> Hello, Please review the following (documentation) change for https://bugs.openjdk.java.net/browse/JDK-8233795: http://cr.openjdk.java.net/~prappo/8233795/webrev.00/ The detailed explanation can be found in the description in the JBS issue. Thanks, -Pavel From hannes.wallnoefer at oracle.com Wed Jan 22 13:15:53 2020 From: hannes.wallnoefer at oracle.com (=?utf-8?Q?Hannes_Walln=C3=B6fer?=) Date: Wed, 22 Jan 2020 14:15:53 +0100 Subject: RFR [15] 8233795: Consider adding a notion of a Value-based class to API Documentation index In-Reply-To: <553EA827-AFC7-432B-BB3B-125277E33CEE@oracle.com> References: <553EA827-AFC7-432B-BB3B-125277E33CEE@oracle.com> Message-ID: Nice. +1 Hannes > Am 22.01.2020 um 12:58 schrieb Pavel Rappo : > > Hello, > > Please review the following (documentation) change for https://bugs.openjdk.java.net/browse/JDK-8233795: > > http://cr.openjdk.java.net/~prappo/8233795/webrev.00/ > > The detailed explanation can be found in the description in the JBS issue. > > Thanks, > -Pavel > From pavel.rappo at oracle.com Wed Jan 22 16:00:18 2020 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Wed, 22 Jan 2020 16:00:18 +0000 Subject: RFR: [15] JDK-8237492 Reorganize impl of doclet options In-Reply-To: <6eb4768a-d1aa-9137-a30b-d4459fbd4eba@oracle.com> References: <842d95f8-a31d-b1cd-34f3-f11e924c78cb@oracle.com> <6eb4768a-d1aa-9137-a30b-d4459fbd4eba@oracle.com> Message-ID: <10C98B07-CE1B-4993-B9D9-8838FEB9022B@oracle.com> > On 21 Jan 2020, at 18:55, Jonathan Gibbons wrote: > > Pavel, > > All great feedback, and all points addressed, as described in the details inline below. > > New webrev, addresses all your comments, adds a couple of class-level doc comments > to the two new classes, and fixes a couple of inconsequential spelling errors. Otherwise, > no changes in all the other affected files. > > http://cr.openjdk.java.net/~jjg/8237492/webrev.01/ Thanks for patiently addressing my comments. I see this code review as an opportunity to get familiar with the javadoc code base. > > > The ongoing task is to draw lines around parts of the hodge-podge that is > {Base,Html}Configuration, and to pull out those parts into separate, better > defined abstractions. A noble intent. > > >> 1. You have reintroduced a forgotten bounded wildcard to >> >> public Set getSupportedOptions() >> >> Good. Compatibility-wise this should be benign. Hopefully, no one tries to put >> anything into that set, which should be assumed unmodifiable anyway. > > It's only an internal API, and we control the implementations. As they say, > "No public API was affected in the making of this changeset." StandardDoclet is a public SPI. Doclets may extend that class, but it's the "container" that calls the `getSupportedOptions` method. A corner case where the client calls `getSupportedOptions` would be an implementation of Doclet that delegates calls to an internal instance of StandardDoclet: public class MyDoclet implements Doclet { private final StandardDoclet standardDoclet = new StandardDoclet(); // ... @Override public Set getSupportedOptions() { Set