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

Lombok refactoring replaces non-default code #688

Open
rillig-tk opened this issue Oct 22, 2019 · 1 comment
Open

Lombok refactoring replaces non-default code #688

rillig-tk opened this issue Oct 22, 2019 · 1 comment

Comments

@rillig-tk
Copy link

rillig-tk commented Oct 22, 2019

Short description

public class Demo {
    private int x;
    public int getX() { x + 1; }
}

When the above code is refactored using Lombok > Default @data, the generated code does not correspond to the previous behavior:

  • Before, there was no setter for x.
  • Before, the getter for x returned a slight variation of x.

Since this Lombok > Default @data refactoring is the only obvious way I see to transform my code to Lombok, I am now unsure how to convert my code to the Lombok style.

Expected behavior

The refactoring preserves the current behavior of the code.
Existing getters are only removed if they conform to the standard form, which is:

public \S+ get(\w+)\(\) \{\s+return (?:this\.)?\1;\s+\}.

Version information

  • IDEA Version: 2019.2
  • Lombok Plugin Version: 4.3

See also

@mplushnikov
Copy link
Owner

Has duplicate #555

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

2 participants