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

[Regression: 1.16.8] Delombok issue with for loop and @Getter field #1076

Closed
Maia-Everett opened this issue Apr 6, 2016 · 3 comments
Closed

Comments

@Maia-Everett
Copy link

The attached file fails to properly delombok with 1.16.8. 1.16.6 works correctly.

import java.util.List;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import lombok.val;

public class DelombokLoopError {
    @Getter
    private String internalStuff;

    public void doStuff(final List<String> stuff) {
        int endIndex;

        for (endIndex = stuff.size() - 1; endIndex >= 0; endIndex--) {

        }
    }
}

1.16.6 result (correct):

// Generated by delombok at Wed Apr 06 21:47:16 NOVT 2016

import java.util.List;
import lombok.Setter;
import lombok.val;

public class DelombokLoopError {

    private String internalStuff;

    public void doStuff(final List<String> stuff) {
        int endIndex;
        for (endIndex = stuff.size() - 1; endIndex >= 0; endIndex--) {
        }
    }

    @java.lang.SuppressWarnings("all")
    @javax.annotation.Generated("lombok")
    public String getInternalStuff() {
        return this.internalStuff;
    }
}

1.16.8 result (incorrect):

// Generated by delombok at Wed Apr 06 21:46:51 NOVT 2016

import java.util.List;
import lombok.Setter;
import lombok.val;

public class DelombokLoopError {
    private String internalStuff;

    public void doStuff(final List<String> stuff) {
        int endIndex;
        for (endIndex = stuff.size() - 1;
; endIndex >= 0; endIndex--) {
        }
    }

    @java.lang.SuppressWarnings("all")
    @javax.annotation.Generated("lombok")
    public String getInternalStuff() {
        return this.internalStuff;
    }
}

Note the double semicolon in the for loop, which makes the code fail to compile.

Without the @Getter field internalStuff, the code delomboks correctly. The mere existence of any kind of @Getter field seems to produce this behavior.

DelombokLoopError.java.txt

@Maia-Everett
Copy link
Author

Still not fixed in 1.16.10.

rspilker added a commit that referenced this issue Jul 19, 2016
@rspilker
Copy link
Collaborator

It is fixed now. Can you try out the edge release and tell us if it fixes your problem?

@rspilker rspilker added the parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these. label Jul 19, 2016
@Maia-Everett
Copy link
Author

Seems fixed for me. Thank you!

@rspilker rspilker removed the parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these. label Oct 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants