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 - Patch for: Remove unnecessary semicolon - hint
Summary: Patch for: Remove unnecessary semicolon - hint
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-07 12:30 UTC by markiewb
Modified: 2014-07-09 21:38 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed patch (30.16 KB, patch)
2014-06-07 12:30 UTC, markiewb
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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