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 151163 - Generating delegate method does not recognize static methods (and displays hint)
Summary: Generating delegate method does not recognize static methods (and displays hint)
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-23 15:51 UTC by Petr Dvorak
Modified: 2016-07-07 07:17 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 Petr Dvorak 2008-10-23 15:51:43 UTC
Product Version: NetBeans IDE Dev (Build 200810230201)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13
System: Linux version 2.6.24-19-generic running on i386; UTF-8; en_US (nb)

This is another issue from the category "IDE generates code and then displays a hint suggesting how to fix it". I hope
there will not be a discussion as with some other issues of this kind:).

When you generate a delegate method for a static method, a hint suggesting replacing an instance with a class reference
is shown.

For example:

1. Have a class like this:

class A {
  private String S;
  
}

2. Invoke Insert Code > Delegate method
3. Select "S" in the left part of the dialog and "copyValueOf" in the right part of a dialog, confirm
-> Resulting code is:

class A {
  private String S;
  public static String copyValueOf(char[] data) {
    return S.copyValueOf(data); // hint: Replace with class reference => return String.copyValueOf(data);
  }
}
Comment 1 Rastislav Komara 2009-02-03 10:54:54 UTC
Overtake.
Comment 2 Jan Lahoda 2009-08-20 09:59:32 UTC
Reassigning all moonko's java/source bugs to myself.
Comment 3 Martin Balin 2016-07-07 07:17:16 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss