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

Summary: Replace Constructor with Factory fails in local class
Product: java Reporter: Jachym_Vojtek
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

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