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 95658 - Java method completion does not offer "overrides"
Summary: Java method completion does not offer "overrides"
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 97580 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-02-15 10:35 UTC by Kirill Sorokin
Modified: 2008-04-25 12:47 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kirill Sorokin 2007-02-15 10:35:24 UTC
When declaring a method and trying to complete its name, the only options I have
are based on the currently typed characters of the name and its return type. In
previous versions there was also an option to complete the name so that the
method overrides or implements a method in a parent class/interface (it did not
work correctly in most of the cases, but yet was very useful).

P2, since it's a regression.

--
NetBeans IDE Dev (Build 200702141900)
1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
Windows XP version 5.1 running on x86
ru_RU (nb); Cp1251
Comment 1 Kirill Sorokin 2007-02-15 10:39:17 UTC
I would really like to see the described functionality back. Alongside with some
improvements if possible.

First, the method should be completed where I type, not at the end of class, as
it was in 5.5. 

Second, an @Override annotation should be automatically inserted (if the
projects source level is >=1.5).

Sounds like a Christmas wish-list, ain't it? :)
Comment 2 Jiri Prox 2007-02-15 11:02:03 UTC
Almost all from your wishlist is already implemented (and it's not even X-mas
yet :). To invoke it type "toStr" , e.g. name w/o modificators and return type
and the CC should provide overridig toString() method. 
I guess the matching algoritm should be improved to be able to accept also
modifiers and return type, so the overriding method toString() should be
suggested also when typed something like: public String toSt
Comment 3 Kirill Sorokin 2007-02-15 11:05:54 UTC
Yeah, that's exactly what I was suggesting. :) Is this possible?
Comment 4 Kirill Sorokin 2007-02-15 11:10:29 UTC
I've just tried the suggested way of codecompleting overriding methods. Works
like a charm, except for two minor (micro?) glitches. 

1) The caret after code completion is not positioned inside the completed
method, while it should be, IMHO. As an addon to this - I would expect the
default contents of the method to get selected, so that it's easier for me to
start filling it with sensible content.

2) I get an extra blank line after the method.
Comment 5 Dusan Balek 2007-03-13 09:31:48 UTC
*** Issue 97580 has been marked as a duplicate of this issue. ***
Comment 6 Jan Lahoda 2007-03-20 11:26:08 UTC
Sorry, but I do not think we should call this a regression - in NB5.5, it was
more a bug that the CC provided "override" for started methods. Simply try to
confirm the item - the CC will break your source code. So, from my point of
view, this is more an enhancement (to extended context evaluation to handle
partially written signatures). Leaving on Dusan to decide.

See also issue #73644.
Comment 7 Jiri Prox 2008-04-11 00:52:59 UTC
moving opened issues from TM <= 6.1 to TM=Dev