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

@Data doesn't honor configuration keys for @ToString @EqualsAndHashCode #1329

Closed
sinuhepop opened this Issue Mar 9, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@sinuhepop

sinuhepop commented Mar 9, 2017

As a example, let's have these classes:

public class Test {
	public static void main(String... args) {
		System.out.println(new A("a"));
		System.out.println(new B("b"));
	}
}
@ToString
@RequiredArgsConstructor
public class A {
	private final String x;

	public String getX() {
		System.out.println("getX() invoked on " + this.getClass());
		return x;
	}
}
@Data
public class B {
	private final String x;

	public String getX() {
		System.out.println("getX() invoked on " + this.getClass());
		return x;
	}
}

And a lombok.config file:

config.stopBubbling = true
lombok.toString.doNotUseGetters = true

Execution prints:

A(x=a)
getX() invoked on class lombok.test.B
B(x=b)

So, property lombok.toString.doNotUseGetters isn't read by @Data. Maybe it's not a bug, but a wanted functionality. I probably won't agree with that, but I think at least som property like lombok.data.toString.doNotUseGetters is needed. Same happens for other properties of @ToString and @EqualsAndHashCode, but not for @Getter/@Setter.

@rspilker

This comment has been minimized.

Collaborator

rspilker commented Mar 22, 2017

Fixed in 969ed91

@rspilker rspilker closed this Mar 22, 2017

@rspilker

This comment has been minimized.

Collaborator

rspilker commented Mar 22, 2017

Thanks for bringing this up.

@sinuhepop

This comment has been minimized.

sinuhepop commented Apr 2, 2017

Thanks to you, guys

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