Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 478011

Summary: Quick Fix for "Bind constructor parameter to fields"
Product: [Eclipse Project] JDT Reporter: Lars Vogel <Lars.Vogel>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: noopur_gupta
Version: 4.5   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Lars Vogel CLA 2015-09-21 20:17:57 EDT
Would be great to have a quick fix for assigning all constructor argument to new or existing fields, similar to IntelliJ.

public class User {

    public User(String firstName, String lastName) {
    }
}

Press quick fix in IntelliJ and select "Bind constructor parameter to fields" and you end up with:

public class User {

    private final String firstName;
    private final String lastName;

    public User(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
    }
}
Comment 1 Noopur Gupta CLA 2015-09-22 05:24:59 EDT

*** This bug has been marked as a duplicate of bug 318681 ***