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 252925 - Replace Constructor with Factory fails in local class
Summary: Replace Constructor with Factory fails in local class
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-11 08:03 UTC by Jachym_Vojtek
Modified: 2015-06-11 08:03 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 Jachym_Vojtek 2015-06-11 08:03:50 UTC
NetBeans 8.0.2
1) Create class
package bug21232375;

public class Class3 {
    void test() {
        class LocalClass {
            String _s;

            LocalClass() {
                this("Hello World!");
            }

            LocalClass(String s) { //#12
                _s = s;
            }

            void saySomething() {
                System.out.println(_s);
            }
        }

        new LocalClass("Hello World!").saySomething();
        LocalClass lc = new LocalClass("Hi");
        lc.saySomething();
    }


}

2) Right click in LocalClass(String s) constructor signature, line 12

3) Refactor->Replace Constructor With Factory...

This lead to:
Module Java Refactoring threw java.lang.NullPointerException. Please report a bug against Java Refactoring module and attach your var/log/messages.log.
and 
refactoring is not performed