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 235331 - Constructor not renamed upon class rename
Summary: Constructor not renamed upon class rename
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.4
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-30 18:17 UTC by ionuion
Modified: 2013-08-31 09:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screencast (6.00 MB, video/quicktime)
2013-08-30 18:17 UTC, ionuion
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ionuion 2013-08-30 18:17:21 UTC
Created attachment 139511 [details]
screencast

Environment:
Product Version: NetBeans IDE Dev (Build 201308300001)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b40
System: Mac OS X version 10.7.5 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/ionuion/Library/Application Support/NetBeans/dev
Cache directory: /Users/ionuion/Library/Caches/NetBeans/dev

Steps to reproduce
1. Create new project from samples: Anagram Game
2. Open StaticWordLibrary class
3. Replace the class name in the file with StaticWordLibrary3
4. Select SelectWordLibrary.java in the Projects window.
5. Click Ctrl-R. Rename the class to StaticWordLibrary3

Expected result:
the class is renamed as well as the constructor

Actual result:
only the class is renamed, the constructor name stays the same, leaving the class in an error state.

Screencast attached.
Comment 1 Ralph Ruijs 2013-08-31 09:53:10 UTC
Because you changed the class name, it no longer has a declared constructor. Renaming the class will update all occurrences of this type, but as you changed it, it is probably not used, is not declared in a file with the same name and has no constructors.