You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Trying to use @Accessors(fluent = true) together with @With doeesn't work. @With does not generate fluent APIs and ignores @Accessors(fluent = true).
To Reproduce
importlombok.AllArgsConstructor;
importlombok.Getter;
importlombok.Value;
importlombok.With;
importlombok.experimental.Accessors;
publicclassWeird {
// This is some class that isn't fluent, but works.@With@Value@AllArgsConstructorclassNotFluent {
finalStringsbrubbles;
}
publicvoidsomeRandomMethod1() {
// Compiles ok, but is not in the fluent style.vara = newNotFluent("foo").withSbrubbles("bar").getSbrubbles();
}
// Ok, now let's suppose that we refactor that into a fluent style.// So, if we add @Accessors(fluent = true), we're done, all the getters// and with-ers would be automatically renamed, right?// Let's try that:@With@Value@Accessors(fluent = true)
@AllArgsConstructorclassShouldBeFluent {
finalStringsbrubbles;
}
publicvoidsomeRandomMethod2() {
// Didn't work, this does not compiles!vara = newShouldBeFluent("foo").sbrubbles("bar").sbrubbles();
// Instead, the following compiles.// The @With didn't care about @Accessors(fluent = true)!varb = newShouldBeFluent("foo").withSbrubbles("bar").sbrubbles();
}
// Ok, not a big deal... But, now let's suppose we have the following scenario:interfaceFluentInterface<F> {
Stringsbrubbles();
Fsbrubbles(StringnewValue);
}
@With@Value@Accessors(fluent = true)
@AllArgsConstructorclassShouldImplementsItNicelyimplementsFluentInterface<ShouldImplementsItNicely> {
finalStringsbrubbles;
}
// We get the following compile error:// Weird.ShouldImplementsItNicely is not abstract and does not override// abstract method sbrubbles(String) in FluentInterface
}
Expected behavior
Usage of @With and @Accessors(fluent = true) together should work.
Version info (please complete the following information):
Lombok version = 1.18.34
Platform = OpenJDK 21
The text was updated successfully, but these errors were encountered:
Describe the bug
Trying to use
@Accessors(fluent = true)
together with@With
doeesn't work.@With
does not generate fluent APIs and ignores@Accessors(fluent = true)
.To Reproduce
Expected behavior
Usage of
@With
and@Accessors(fluent = true)
together should work.Version info (please complete the following information):
The text was updated successfully, but these errors were encountered: