Community
Participate
Working Groups
Build Identifier: M20100211-1343 Formatting the following java source file package fr.inist.refdoc.dtdNotice; public class C { /** * aaaa aaa aaa.<br> * {@link C}: aaaa.<br> * {@link C}: aaaa.<br> * aaa {@link C}: aaaa.<br> * {@link C}: aaaa<br> * {@link C}: aaaa.<br> */ public C() { } } is wrong. There is no new line after the <br> tag if it is followed by a {@link. The formatted source file is: package fr.inist.refdoc.dtdNotice; public class C { /** * aaaa aaa aaa.<br> {@link C}: aaaa.<br> {@link C}: aaaa.<br> * aaa {@link C}: aaaa.<br> {@link C}: aaaa<br> {@link C}: aaaa.<br> */ public C() { } } The only line break is after the <br> followed by aaa. I would have expected the format command to do nothing in this example. Reproducible: Always Steps to Reproduce: 1.Create a java class as: package fr.inist.refdoc.dtdNotice; public class C { /** * aaaa aaa aaa.<br> * {@link C}: aaaa.<br> * {@link C}: aaaa.<br> * aaa {@link C}: aaaa.<br> * {@link C}: aaaa<br> * {@link C}: aaaa.<br> */ public C() { } } 2. Format the source file.
Reproduced using 3.6RC3. Note that you have a simple workaround, put the lines inside a paragraph: public class X02 { /** * <p> * aaaa aaa aaa.<br> * {@link X02}: aaaa.<br> * {@link X02}: aaaa.<br> * aaa {@link X02}: aaaa.<br> * {@link X02}: aaaa<br> * {@link X02}: aaaa.<br> * </p> */ public X02() { } } Then, the formatter will let the lines untouched as expected...
I didn't thought of that. I tried, and yes, formatting worked as I expected. But I won't apply it because I don't want to spend time doing that (manually) in all in my sources files, having to undo it once fixed, and not being sure that it works in all cases. As it is just an annoyance, I prefer doing nothing and wait for a real solution.
Created attachment 172503 [details] Proposed patch Specifying that the formatter javadoc html tag needs to be followed by a new line was missing in some cases (typically when followed by a inline block). This patch fixes this and the output will be correct now...
(In reply to comment #3) > Created an attachment (id=172503) [details] > Proposed patch > Released for 3.7M1 in HEAD stream.
Verified for 3.7 M1 using build I20100802-1800