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 136203

Summary: NPE attempting to encapsulate field that's already encapsulated
Product: java Reporter: vaughn <vaughn>
Component: RefactoringAssignee: issues@java <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: messages.log showing NPE with multiple encapsulate bug

Description vaughn 2008-05-30 23:56:23 UTC
Selected 3 fields and tried Refactor > Encapsulate Fields. One of the selected fields was previously encapsulated. IDE
threw java.lang.NullPointerException. Here's the source that caused the problem.

public class ServletController {

    private final UriFromClient uriFromClient;
    private final ClientCommunicator clientCommunicator;
    private final UriParser uriParser;

    public UriFromClient getUriFromClient() {
        return uriFromClient;
    }

    public ServletController(UriFromClient ufm, ClientCommunicator cc, UriParser up) {
        this.uriFromClient = ufm;
        this.clientCommunicator = cc;
        this.uriParser = up;
    }
}
Comment 1 vaughn 2008-05-30 23:59:04 UTC
Created attachment 62197 [details]
messages.log showing NPE with multiple encapsulate bug
Comment 2 Jiri Prox 2008-06-02 08:53:06 UTC
This issue is already fixed and the fix will be included in patch 2. Thanks for your report anyway.

*** This issue has been marked as a duplicate of 131619 ***