Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 244934 - Patch for: Remove unnecessary semicolon - hint
Patch for: Remove unnecessary semicolon - hint
Status: RESOLVED FIXED
Product: java
Classification: Unclassified
Component: Hints
8.0
PC Windows 7
: P3 (vote)
: 8.0.1
Assigned To: Svata Dedic
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-07 12:30 UTC by markiewb
Modified: 2014-07-09 21:38 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo