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 134648 - Create Method hint: Wrong position of method and cursor
Summary: Create Method hint: Wrong position of method and cursor
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Svata Dedic
Depends on:
Reported: 2008-05-07 07:33 UTC by Jan Becicka
Modified: 2013-09-02 14:25 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Jan Becicka 2008-05-07 07:33:12 UTC

    public String getName() {
(o)     test();
        return NbBundle.getMessage(QuickSearchAction.class, "CTL_QuickSearchAction");

    protected String iconResource() {
        return "org/netbeans/modules/jumpto/resources/edit_parameters.png";

    public HelpCtx getHelpCtx() {
        return HelpCtx.DEFAULT_HELP;

    protected boolean asynchronous() {
        return false;

    public java.awt.Component getToolbarPresenter() {
        return retValue;

| <--cursor
    private void test() {
        throw new UnsupportedOperationException("Not yet implemented");

I would expect, that test() method should be generated right after getName(), not at the end of class. User will lose
context of editing. And method body should be preselected. Otherwise user is forced to go into method, delete body and
then start coding.
Comment 1 Max Sauer 2008-07-01 13:59:45 UTC
Method body preselection has been fixed as part of

Comment 2 Max Sauer 2008-07-08 09:17:40 UTC
The method position is not easy to correct and changes would be possibly inconsistent with other generation behaviour -- currently, we insert the method 
at the end of block of class members with same priority (GeneratorUtilities ClassMemberComparator).