Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a @OverrideConstructors annotation #1286

Closed
manuel-hegner opened this issue Feb 2, 2017 · 4 comments
Closed

Add a @OverrideConstructors annotation #1286

manuel-hegner opened this issue Feb 2, 2017 · 4 comments

Comments

@manuel-hegner
Copy link

manuel-hegner commented Feb 2, 2017

It would be nice to have an @OverrideConstructors annotation. This annotation would create one constructor for each constructor of the super class. That is a common use case if you subclass classes with multiple constructors.

I would be willing to try my hand on a pull request if you deem this annotation useful.

@omega09
Copy link

omega09 commented Feb 3, 2017

Can you give a code example of with and without your annotation?

@manuel-hegner
Copy link
Author

Sure:
Without Lombok:

public class CustomException extends Exception {

    public CustomException(String message) {
        super(message);
    }

    public CustomException(String message, Throwable throwable) {
        super(message, throwable);
    }

    public CustomException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    ...
}

With Lombok:

@OverrideConstructors
public class CustomException extends Exception {}

@omega09
Copy link

omega09 commented Feb 4, 2017

Issue #375

@rspilker
Copy link
Collaborator

rspilker commented Feb 6, 2017

This requires resolution, not something lombok can do right now.

@rspilker rspilker closed this as completed Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants