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

Comments

Projects
None yet
2 participants
@Maia-Everett

Maia-Everett commented Apr 6, 2016

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

This comment has been minimized.

Show comment
Hide comment
@Maia-Everett

Maia-Everett Jul 15, 2016

Still not fixed in 1.16.10.

Maia-Everett commented Jul 15, 2016

Still not fixed in 1.16.10.

rspilker added a commit that referenced this issue Jul 19, 2016

@rspilker

This comment has been minimized.

Show comment
Hide comment
@rspilker

rspilker Jul 19, 2016

Collaborator

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

Collaborator

rspilker commented Jul 19, 2016

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

@rspilker rspilker added the parked label Jul 19, 2016

@Maia-Everett

This comment has been minimized.

Show comment
Hide comment
@Maia-Everett

Maia-Everett Jul 20, 2016

Seems fixed for me. Thank you!

Maia-Everett commented Jul 20, 2016

Seems fixed for me. Thank you!

@rspilker rspilker closed this Jul 22, 2016

@rspilker rspilker removed the parked label Oct 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment