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 220581 - Name of the created method does not work in generate method body template
Summary: Name of the created method does not work in generate method body template
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-22 13:40 UTC by Jiri Prox
Modified: 2012-10-23 12:07 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 Jiri Prox 2012-10-22 13:40:59 UTC
Name of the created method does not work in generate method body template. It is replaced only by '$'

Steps to reproduce:
1) change template for generated method body to contain: 
${method_name}

2) use create method hint to generate method

->  ${method_name} is replaced only by '$'


Product Version: NetBeans IDE Dev (Build 201210220002)
Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b03
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev
Comment 1 Dusan Balek 2012-10-22 14:41:08 UTC
Unfortunately, I cannot reproduce the issue in the current dev build. Could you please describe the exact steps to reproduce (content of the generated method body template, test source, and operation to perform). Thanks.
Comment 2 Jiri Prox 2012-10-22 14:53:55 UTC
Steps to reproduce:
1) edit the template for generated method to contain

/*
${method_name}              name of the created method
*/
throw new java.lang.UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.

2) in the code type "newMethod();"
3) use hint to create missing method

-> new method is generated but it contains:
    private static void newMethod() {
        /*
        $              name of the created method
         */
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
Comment 3 Dusan Balek 2012-10-22 15:41:02 UTC
Fixed in jet-main. Thanks for the reproducible test case.

http://hg.netbeans.org/jet-main/rev/d7ce6d059062
Comment 4 Quality Engineering 2012-10-23 12:07:18 UTC
Integrated into 'main-golden', will be available in build *201210231040* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d7ce6d059062
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #220581: Name of the created method does not work in generate method body template - fixed.