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 220597 - Replace ctor with builder fails to create inner class
Summary: Replace ctor with builder fails to create inner class
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-22 15:44 UTC by _ rkubacki
Modified: 2015-09-17 11:15 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 _ rkubacki 2012-10-22 15:44:46 UTC
Often builder pattern uses an inner class for the builder class. NetBeans refactoring fails if I try to replace ctor in com.foo.Bar with new builder com.foo.Bar.Builder - it generated new corrupted source.
Comment 1 Ralph Ruijs 2012-11-08 11:51:36 UTC
The current implementation has no support for inner classes. => enhancement

I do not think we want to make the configuration more strict, as the current outcome is easily fixed after running the refactoring.
Comment 2 _ rkubacki 2012-11-09 12:50:37 UTC
There is no way to find out that it is not supported. I used IDE and it corrupted my sources and you say it is not defect ...

And again: it is common to use inner class. Look at some existing libraries like Guava or some talk on design pattern like one by Joshua Bloch.
Comment 3 Martin Balin 2015-09-17 11:15:44 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.