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 244934

Summary: Patch for: Remove unnecessary semicolon - hint
Product: java Reporter: markiewb
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: Windows 7   
See Also: https://netbeans.org/bugzilla/show_bug.cgi?id=241877
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Proposed patch

Description markiewb 2014-06-07 12:30:06 UTC
Created attachment 147601 [details]
Proposed patch

EXPECTED:
A hint "Unnecessary semicolon" should appear for this statement:
   System.out.println("hello world");;
When the user presses Enter, the semicolon should be removed.

First I started to create a hint in my own plugin, but there was a bug [1]/[2], which prevented me to continue.

So after [1] in the NB sources had been fixed, I implemented it as a patch for the NB sources. So I like to propose a patch to solve this issue.

The patch is a major refactoring of org.netbeans.modules.java.hints.EmptyStatements :
* migration/simplification by using TriggerTreeKind and @Hint annotations
* no more explicit registration in layer.xml
* reuse of the existing resources (labels, descriptions, ids) of the EmptyStatements hint 
* unit tests

BTW: This patch also fixes [3] 

Please give it a try, review and commit. 

[1] https://netbeans.org/bugzilla/show_bug.cgi?id=244632
[2] https://github.com/markiewb/nb-additional-hints/issues/38
[3] https://netbeans.org/bugzilla/show_bug.cgi?id=241877
Comment 1 Dusan Balek 2014-06-09 08:51:14 UTC
Integrated into jet-main. Thanks for the patch.

http://hg.netbeans.org/jet-main/rev/af8a67c359b7
Comment 2 markiewb 2014-07-09 21:38:17 UTC
@Svata: I guess the target milestone was wrong (8.0). I set it to 8.0.1