<div dir="auto">Appreciated. Thanks. <br clear="all"><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>/max<br></div><a href="https://about.me/maxandersen" target="_blank">https://about.me/maxandersen</a><br></div></div></div></div><div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 10, 2024 at 16.27 David Lloyd <<a href="mailto:david.lloyd@redhat.com">david.lloyd@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">The bug is at <a href="https://bugs.openjdk.org/browse/JDK-8341907" target="_blank">https://bugs.openjdk.org/browse/JDK-8341907</a> - sorry about the formatting, I'm not sure how to switch it to "text" mode from "visual" mode (it seems like some fields/bug types enter in text mode and some are stuck in visual mode?).</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 10, 2024 at 9:14 AM Pavel Rappo <<a href="mailto:pavel.rappo@oracle.com" target="_blank">pavel.rappo@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I would appreciate it if you could submit a bug, David.<br>
<br>
> On 10 Oct 2024, at 15:08, David Lloyd <<a href="mailto:david.lloyd@redhat.com" target="_blank">david.lloyd@redhat.com</a>> wrote:<br>
> <br>
> I can open a bug for that Max.<br>
> <br>
> On Wed, Oct 9, 2024 at 12:40 PM Max Rydahl Andersen <<a href="mailto:manderse@redhat.com" target="_blank">manderse@redhat.com</a>> wrote:<br>
> Hi,<br>
> I noticed that Java 23 javac -Xlint:dangling-doc-comments test.java<br>
> where test.java is:<br>
> ///usr/bin/env jbang "$0" "$@" ; exit $?<br>
> <br>
> /**<br>
> * test<br>
> */<br>
> public class test {<br>
> <br>
> public static void main(String[] args) {<br>
> System.out.println("Javadoc should not complain about the 1st line");<br>
> }<br>
> }<br>
> <br>
> Now result in:<br>
> test.java:1: warning: [dangling-doc-comments] documentation comment is not attached to any declaration<br>
> ///usr/bin/env jbang "$0" "$@" ; exit $?<br>
> ^<br>
> 1 warning<br>
> <br>
> which is unfortunate given that this top-line construct is a common thing in unix based shells to use for<br>
> enabling scripts to run.<br>
> In this case I'm using jbang, but it is also common for others - kotlin script, go script, scala and others use it; been valid for longer than Java existed.<br>
> Thus, it is unfortunate that this is flagged by the linter which IDE's are enabling and you end up with bug reports<br>
> for something that is not actually a bug.<br>
> My suggestion is that the linter would not complain if the line is the very first line in the file, and there is no space.<br>
> i.e. it should let this pass:<br>
> ///usr/bin/env jbang "$0" "$@" ; exit $?<br>
> <br>
> public class test<br>
> <br>
> but complain about<br>
> /// An actual comment<br>
> <br>
> public class test<br>
> <br>
> and<br>
> package org.acme;<br>
> /// An actual comment<br>
> <br>
> /**<br>
> * test<br>
> */<br>
> public class test<br>
> <br>
> I'm happy to look into a PR for it but wanted to start with getting it recognized as bug/issue first.<br>
> Could someone with the right powers open a bug for it?<br>
> Thank you,<br>
> /max<br>
> <a href="https://xam.dk/about" rel="noreferrer" target="_blank">https://xam.dk/about</a><br>
> <br>
> <br>
> -- <br>
> - DML • he/him<br>
<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">- DML • he/him<br></div></div>
</blockquote></div></div>