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.
The "Create Field" hint should display the field name too. Example A) ---------- public class NewClass { public NewClass(String a|, String b, String c ) { } } Note: | defines the current position of the caret * invoke fix code, all suitable hints are displayed ACTUAL: hint with label "Create Field" is shown EXPECTED: hint with label "Create Field 'a'" is shown Example B) ---------- public class NewClass { private final String a; public NewClass(String a|, String b, String c ) { } } Note: | defines the current position of the caret * invoke fix code, all suitable hints are displayed ACTUAL: hint with label "Assign to Existing Field" is shown EXPECTED: hint with label "Assign to Existing Field 'a'" is shown
Created attachment 134396 [details] Proposed patch I like to propose a patch to solve the issue. It shows the fieldname in the label of the hint. See the screenshot (to be attached) @Jan: Please review and commit, if appropriate. Thank you!
Created attachment 134397 [details] Patch in action
@Jan: If you like/you have time, you could also add the target class in the label too and thus resolve https://netbeans.org/bugzilla/show_bug.cgi?id=135962 ?!
Looks good, thanks, except I don't think the "if (treePath.getLeaf().getKind() == Kind.VARIABLE)" is needed - treePath.getLeaf() is already casted to VariableTree before, and a local variable exists for it ("var"). I can simplify the patch for you, if you wish. I am also thinking if the warning message should not be dropped (the warning messages for suggestions are typically only confusing to users), but that does not need to be decided/resolved here.
(In reply to comment #4) > Looks good, thanks, except I don't think the "if (treePath.getLeaf().getKind() > == Kind.VARIABLE)" is needed - treePath.getLeaf() is already casted to > VariableTree before, and a local variable exists for it ("var"). I can simplify > the patch for you, if you wish. > > I am also thinking if the warning message should not be dropped (the warning > messages for suggestions are typically only confusing to users), but that does > not need to be decided/resolved here. Hi Jan. Feel free to change the patch as you need/like. The visible result is more important for me - not the tiny details. If you want me to provide a more suitable patch then tell me and i will provide it...
@Svata: Please review the patch
Patch applied as jet-main#a2295e25a223 (minor polishing).
@Dusan: Not yet integrated? I cannot see the issue fixed in Product Version: NetBeans IDE Dev (Build 201407260001)
Integrated into 'main-silver', will be available in build *201407300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/a2295e25a223 User: Svata Dedic <sdedic@netbeans.org> Log: #229684: field names displayed in hint label (patch by Markiweb)