RFR: 8247957: remove doclint support for HTML 4 [v5]
Jonathan Gibbons
jjg at openjdk.java.net
Wed Dec 23 17:12:03 UTC 2020
On Wed, 23 Dec 2020 15:53:00 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
>> One must-fix item (bad pattern constant.)
>
> \s was introduced as a valid escape character in JDK 15 as part of the
> support for Text Blocks.
>
> https://docs.oracle.com/javase/specs/jls/se15/html/jls-3.html#jls-EscapeSequence
> https://docs.oracle.com/javase/specs/jls/se14/preview/specs/text-blocks-jls.html#jls-3.10.7
>
> FWIW, the escape sequence showed up with red squiggly lines in my IDE.
>
> -- Jon
>
> On 12/22/20 9:38 PM, Yoshiki SATO wrote:
>>
>> *@satoyoshiki* commented on this pull request.
>>
>> ------------------------------------------------------------------------
>>
>> In
>> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java
>> <https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/893*discussion_r547668049__;Iw!!GqivPVa7Brio!OUEFldgNdIV8aqoReM0lNXfIYO3IoXGR1RUbcYmVdEHRRdA3oy1Zaa3h2DevZiYojsWrqg$>:
>>
>> > @@ -765,8 +732,8 @@ private Element getEnclosingPackageOrClass(Element e) {
>> return e;
>> }
>>
>> - //http://www.w3.org/TR/html401/types.html#type-name <https://urldefense.com/v3/__http://www.w3.org/TR/html401/types.html*type-name__;Iw!!GqivPVa7Brio!OUEFldgNdIV8aqoReM0lNXfIYO3IoXGR1RUbcYmVdEHRRdA3oy1Zaa3h2DevZibVYnjqnQ$>
>> - private static final Pattern validName = Pattern.compile("[A-Za-z][A-Za-z0-9-_:.]*");
>> + //https://html.spec.whatwg.org/#the-id-attribute <https://urldefense.com/v3/__https://html.spec.whatwg.org/*the-id-attribute__;Iw!!GqivPVa7Brio!OUEFldgNdIV8aqoReM0lNXfIYO3IoXGR1RUbcYmVdEHRRdA3oy1Zaa3h2DevZib5vw0eRg$>
>> + private static final Pattern validId = Pattern.compile("[^\s]+");
>>
>> Correct. Thanks a lot for finding this error.
>> Now that I have doubts why this line could have been compiled without
>> error. This line should cause a compiler error.
>>
>> Let me review all anchor tests again because the logic should be
>> checked there.
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/893*discussion_r547668049__;Iw!!GqivPVa7Brio!OUEFldgNdIV8aqoReM0lNXfIYO3IoXGR1RUbcYmVdEHRRdA3oy1Zaa3h2DevZiYojsWrqg$>,
>> or unsubscribe
>> <https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AOUXBRXCJBCNZR4ZUBZCEBTSWF66TANCNFSM4TBXTH2Q__;!!GqivPVa7Brio!OUEFldgNdIV8aqoReM0lNXfIYO3IoXGR1RUbcYmVdEHRRdA3oy1Zaa3h2DevZia6kQL08w$>.
>>
On 12/22/20 10:42 PM, Yoshiki SATO wrote:
>
> *@satoyoshiki* commented on this pull request.
>
> ------------------------------------------------------------------------
>
> In
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java
> <https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/893*discussion_r547716025__;Iw!!GqivPVa7Brio!Oae1uD8yALBU6ReCJTwKccZjdEsGyXddDLOOeF2SJLi8x7SoU5jr-Jr0KVl2EVajBRHM-g$>:
>
> > - }
> -
> - private void validateHtml5Attrs(AttributeTree tree, Name name, AttrKind k) {
> - switch (k) {
> - case ALL:
> - case HTML5:
> - break;
> -
> - case INVALID:
> - case OBSOLETE:
> - case USE_CSS:
> - case HTML4:
> - env.messages.error(HTML, tree, "dc.attr.not.supported.html5", name);
> - break;
> - }
> - }
>
> private boolean checkAnchor(String name) {
>
> I understand. But is it really no problem to be done in part of the
> cleanup of doclint?
> Looking at the classes in jdk/javadoc/internal/doclint, the term
> |(anchor|Anchor)| looks like only used in Checker.java and resource
> files. But a lot of other files, for instance in
> jdk/javadoc/internal/doclets, use this term to refer to the |id| or
> |name| attribute. I would be fine if it is supposed to be done in each
> cleanup in the future.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/893*discussion_r547716025__;Iw!!GqivPVa7Brio!Oae1uD8yALBU6ReCJTwKccZjdEsGyXddDLOOeF2SJLi8x7SoU5jr-Jr0KVl2EVajBRHM-g$>,
> or unsubscribe
> <https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AOUXBRQS4FULCERHKMAZ5OLSWGGNVANCNFSM4TBXTH2Q__;!!GqivPVa7Brio!Oae1uD8yALBU6ReCJTwKccZjdEsGyXddDLOOeF2SJLi8x7SoU5jr-Jr0KVl2EVYEkdTG2A$>.
>
If you were to cleanup the "anchor" terminology, it should only be done
in doclint, meaning Checker.java and resource files. Cleaning up
terminology in the rest of javadoc is another project for another day.
But, it's OK to skip this terminology cleanup in doclint at this time,
since it is only peripherally related to the primary goal to remove
HTML4 support.
-- Jon
>
-------------
PR: https://git.openjdk.java.net/jdk/pull/893
More information about the compiler-dev
mailing list