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 119837 - Code generation inserts code at wrong location
Summary: Code generation inserts code at wrong location
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Rastislav Komara
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-23 21:39 UTC by giorgio42
Modified: 2009-11-02 11:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description giorgio42 2007-10-23 21:39:51 UTC
NB 20071023000000, WinXPSP2, 1.6.0_05.

If you have this code:

public class TestInsertLocation {

  private String propertyName;

  ////////////////////////////////////////////////////////////////////
  // Getters and Setters
  
  |
}

and place the cursor below the Getters and Setters comment, then invoke code generation (alt-insert), select Getters and
Setters, select propertyName and press OK, you get:

public class TestInsertLocation {

  private String propertyName;

  public String getPropertyName() {
    return propertyName;
  }

  public void setPropertyName(String propertyName) {
    this.propertyName = propertyName;
  }

  ////////////////////////////////////////////////////////////////////
  // Getters and Setters
  
  
}


The code is inserted above the comment instead of below it.

Georg
Comment 1 Jiri Prox 2007-10-24 10:03:42 UTC
Seems that comments (inline or block) are not respected by insert-code action. 

Comment 2 Rastislav Komara 2009-02-03 10:57:42 UTC
Overtake.
Comment 3 David Strupl 2009-03-31 16:02:56 UTC
Resolving all issues with milestone "future" as LATER. If you feel strongly that
it should be implemented please reopen and set the target milestone to "next".
Comment 4 giorgio42 2009-03-31 20:21:40 UTC
I know it is only a minor annoyance, and, maybe it is a bit hard to fix.

Pros:
- It would be one bug less (NB as about 20000 open bugs in all, Eclipse about 30000 - 35000, although the Eclipse code
base is much larger).
- One step nearer to adhering to the Zero Inbox principle (which translates to Zero [Known] Bugs principle).
- Give the submitter the warm feeling that somebody actually cares.
- All my Java sources are split into sections (predefined in file templates), the sections are separated by comments.
One of these sections is // Getters and Setters. When I generate the first getter/setter pair it always ends up above
the comment instead of below it and I have to correct this manually each time.
Cons:
- I have been doing this for years, I can tolerate doing it for a few more years to come.
- Nobody actually cares about P4 bugs, anyway.
- There are more than 500 open P1 bugs, let's evualate, close or fix those first.

I take the last one. Now if you promise to fix one of those long-term P1 bugs in NB issuezilla instead of this one...

Comment 5 Quality Engineering 2009-11-02 11:00:29 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX