You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Dawid Weiss <da...@gmail.com> on 2020/12/23 10:39:05 UTC

javac reports broken HTML on multiline mailto links

Hello and Merry Christmas,

I discovered this odd javac behavior with jdk8 up to jdk15 (didn't
check the latest head). This source file (note the anchor tag over
multiple lines):

/**
 * Lucene internals or asking for help on <a
 * href="mailto:java-user@lucene.apache.org">java-user@lucene.apache.org</a>
  */
public class Breaks {}

When compiled with

javac -Xdoclint:all/protected Breaks.java

generates this:

Breaks.java:2: error: malformed HTML
 * Lucene internals or asking for help on <a
                                          ^
Breaks.java:3: error: bad use of '>'
 * href="mailto:java-user@lucene.apache.org">java-user@lucene.apache.org</a>
                                            ^
Breaks.java:3: error: unexpected end tag: </a>
 * href="mailto:java-user@lucene.apache.org">java-user@lucene.apache.org</a>
                                                                        ^
What's interesting is that the following two alternatives compile just fine:

/**
 * Lucene internals or asking for help on <a
 * href="http://lucene.apache.org">java-user@lucene.apache.org</a>
  */
public class Passes {}

/**
 * Lucene internals or asking for help on <a
href="mailto:java-user@lucene.apache.org">java-user@lucene.apache.org</a>
to figure out why.
  */
public class Passes2 {}

Is it just me or all these should compile just fine?...

Dawid

[1] Just in case mail clients attempt to reformat the pasted examples,
here's a gist with
the sources:
https://gist.github.com/dweiss/c1c9f218c6a8e5d2f253193806a9f472

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: javac reports broken HTML on multiline mailto links

Posted by Michael Sokolov <ms...@gmail.com>.
Ugh the mailto: breaks it? Seems like a bug to me. Maybe the javadoc parser
tries to validate the content of an href attribute?

On Wed, Dec 23, 2020, 5:39 AM Dawid Weiss <da...@gmail.com> wrote:

> Hello and Merry Christmas,
>
> I discovered this odd javac behavior with jdk8 up to jdk15 (didn't
> check the latest head). This source file (note the anchor tag over
> multiple lines):
>
> /**
>  * Lucene internals or asking for help on <a
>  * href="mailto:java-user@lucene.apache.org">java-user@lucene.apache.org
> </a>
>   */
> public class Breaks {}
>
> When compiled with
>
> javac -Xdoclint:all/protected Breaks.java
>
> generates this:
>
> Breaks.java:2: error: malformed HTML
>  * Lucene internals or asking for help on <a
>                                           ^
> Breaks.java:3: error: bad use of '>'
>  * href="mailto:java-user@lucene.apache.org">java-user@lucene.apache.org
> </a>
>                                             ^
> Breaks.java:3: error: unexpected end tag: </a>
>  * href="mailto:java-user@lucene.apache.org">java-user@lucene.apache.org
> </a>
>                                                                         ^
> What's interesting is that the following two alternatives compile just
> fine:
>
> /**
>  * Lucene internals or asking for help on <a
>  * href="http://lucene.apache.org">java-user@lucene.apache.org</a>
>   */
> public class Passes {}
>
> /**
>  * Lucene internals or asking for help on <a
> href="mailto:java-user@lucene.apache.org">java-user@lucene.apache.org</a>
> to figure out why.
>   */
> public class Passes2 {}
>
> Is it just me or all these should compile just fine?...
>
> Dawid
>
> [1] Just in case mail clients attempt to reformat the pasted examples,
> here's a gist with
> the sources:
> https://gist.github.com/dweiss/c1c9f218c6a8e5d2f253193806a9f472
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>