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 173305 - Renaming (refactoring) label actually renames method
Summary: Renaming (refactoring) label actually renames method
Status: RESOLVED DUPLICATE of bug 165579
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-29 18:29 UTC by stephenpmorgan
Modified: 2011-03-28 12:15 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stephenpmorgan 2009-09-29 18:29:48 UTC
In the following code, renaming (refactoring) the label "nextPos" to "blech" actually renamed the method from "describe"
to "blech."  (Note: I've deleted the comments, changed variable names, and shown only a code snippet, for confidentiality.)


    public String describe(String sample) {
        assert sample != null;

        String privPat = new String(sample);

        nextPos: for (int pos = 0; pos < privPat.length(); pos++) {

            for (FieldPat fp : fieldPatSet) {
                String fpName = fp.getName();
                if (privPat.substring(pos).startsWith(fpName)) {
                    pos += fpName.length();
                    continue nextPos;
                }
            }
        ...

Steve
Comment 1 Jiri Prox 2009-09-29 22:44:01 UTC
The refactoring for label is not implemented now, it just rename the element the cursor is placed over - it this case it
is the wrapping method. 
This can be noticed in the dialog, where message informs about what's is going to be renamed
Comment 2 Jan Becicka 2011-03-28 12:15:18 UTC

*** This bug has been marked as a duplicate of bug 165579 ***