This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 251946 - No proper way to use line break tag
Summary: No proper way to use line break tag
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-20 11:27 UTC by cezariusz
Modified: 2015-05-09 07:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Red highlight of the unclosed br tag. (7.63 KB, image/png)
2015-04-20 11:27 UTC, cezariusz
Details
With 201504280001 <br> is still in red (8.63 KB, image/png)
2015-04-28 14:42 UTC, cezariusz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cezariusz 2015-04-20 11:27:16 UTC
Created attachment 153273 [details]
Red highlight of the unclosed br tag.

Product Version: NetBeans IDE Dev (Build 201504150001)
Updates: Updates available
Java: 1.8.0_25; Java HotSpot(TM) 64-Bit Server VM 25.25-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b18
System: Windows 7 version 6.1 running on amd64; UTF-8; pl_PL (nb)

I see no valid way to use <br> tag in JavaDoc if I don't want to have any warnings or errors. Let's see the following 3 options:

    public enum Sample {
        /**
         * Number 1.
         * <br>The first</br>
         */
        ONE,
        /**
         * Number 2.<br/>
         * The second
         */
        TWO,
        /**
         * Number 3.<br>
         * The third
         */
        THREE
    }

1. This one gives a warning in NetBeans and the error from JavaDoc:
C:\Temp\00netbeans\Testing\src\org\cezariusz\testing\EnumCodeCompletion.java:18: error: invalid end tag: </br>
         * <br>The first</br>

2. The second one gives NO WARNING in NetBeans (!), but the error from JavaDoc:
C:\Temp\00netbeans\Testing\src\org\cezariusz\testing\EnumCodeCompletion.java:22: error: self-closing element not allowed
         * Number 2.<br/>

3. The third one gives no warning in NetBeans, no error from JavaDoc, but the editor highlights it in red and unclosed.

Since we cannot change how JavaDoc works, the only solution I see is to add to NetBeans editor special handling of tags, which are always unclosed.
Comment 1 Ralph Ruijs 2015-04-27 08:47:38 UTC
1. was already working correctly
2. should be fixed by jet-main#734ac9bffde3
3. reassigning to java/editor to evaluate
Comment 2 Quality Engineering 2015-04-28 02:58:03 UTC
Integrated into 'main-silver', will be available in build *201504280001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/734ac9bffde3
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #251946 - Give warning for self-closing element
Comment 3 Dusan Balek 2015-04-28 09:33:49 UTC
Works correctly in dev build - closing as fixed.
Comment 4 cezariusz 2015-04-28 09:47:20 UTC
(In reply to Dusan Balek from comment #3)
> Works correctly in dev build - closing as fixed.

Could you please be more specific? Point 3 doesn't work correctly in 201504270341, which is currently the latest one available for download.
Comment 5 Dusan Balek 2015-04-28 12:34:13 UTC
Will be available in build *201504280001* on http://bits.netbeans.org/dev/nightly/
Comment 6 cezariusz 2015-04-28 14:39:54 UTC
(In reply to Ralph Ruijs from comment #1)
> 3. reassigning to java/editor to evaluate

Again, point 3. is not fixed even in 201504280001. Let me start over. "br" is a void element, which must not be closed nor self-closed:
http://www.w3.org/TR/html-markup/syntax.html#syntax-elements
http://www.456bereastreet.com/archive/201005/void_empty_elements_and_self-closing_start_tags_in_html/

When I use such unclosed element the editor wrongly highlights it in red, suggesting that I should do something with it. Unclosed void elements, which are allowed in JavaDoc, should be highlighted in yellow, as they are perfectly valid. That includes the following elements: <br>, <hr>, <img>, <link>, <meta>.
Comment 7 cezariusz 2015-04-28 14:42:29 UTC
Created attachment 153435 [details]
With 201504280001 <br> is still in red
Comment 8 Dusan Balek 2015-04-29 08:59:46 UTC
I see - caret has to be on '<br>' tag to be displayed in red.

Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/6ccbe90d1684
Comment 9 Quality Engineering 2015-04-30 02:33:56 UTC
Integrated into 'main-silver', will be available in build *201504300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/6ccbe90d1684
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #251946: No proper way to use line break tag - fixed.
Comment 10 cezariusz 2015-05-09 07:36:44 UTC
Verified both fixes with 201505020001.