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 76572 - Renaming a property add an extra underscore (_)
Summary: Renaming a property add an extra underscore (_)
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-18 19:00 UTC by liguorien
Modified: 2007-09-26 09:14 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 liguorien 2006-05-18 19:00:03 UTC
When I rename a property via the Bean Patterns node in the project panel, an
extra underscore (_) is added in the setter and the getter.

Steps to reproduce :

 - Create a new class
 - In the project panel, open the following nodes : TheClass > Bean Patterns
 - Right-click on the "Bean Patterns" node and add a new property (with setter &
getter)
 - Right-click on the "Bean Patterns" node again to rename the property.
 - You will notice that the field name in the setter & getter are wrong.

Here is the generated code before and after the renaming procedure :

BEFORE
------

/**
     * Holds value of property _name.
     */
    private String _name;

    /**
     * Getter for property name.
     * @return Value of property name.
     */
    public String getName() {
        return _name;
    }

    /**
     * Setter for property name.
     * @param name New value of property name.
     */
    public void setName(String name) {
        _name = name;
    }



AFTER
------
/**
     * Holds value of property _name.
     */
    private String _name2;

    /**
     * Getter for property name.
     * @return Value of property name.
     */
    public String getName2() {
        return __name2;
    }

    /**
     * Setter for property name.
     * @param name New value of property name.
     */
    public void setName2(String name2) {
        __name2 = _name2;
    }
Comment 1 Jiri Prox 2006-05-19 13:42:34 UTC
To reproduce this the 'style of declared variable' must be switched to
'_property_Value'
Comment 2 Jan Becicka 2006-10-26 16:27:51 UTC
Javacore module was replaced by Retouche infrastructure. This bug is not valid
in trunk any more.
Comment 3 Quality Engineering 2007-09-20 12:47:06 UTC
Reorganization of java component