-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Description
This one is very useful for teams that migrated
from combination of @AllArgsConstructor(staticName = "of") and @Value or used @Value(staticConstructor = "of")
and now starts the migration for records
Right now using of @AllArgsConstructor(staticName = "of") and @RequiredArgsConstructor(staticName = "of")
generates an error is only supported on a class or an enum
Both of these cases will look good in IDEA but will fail in compile stage
@AllArgsConstructor(staticName = "of")
public record Person(String name, Integer age){}
public static void main(String[] args) {
Person.of();
} @RequiredArgsConstructor(staticName = "of")
public record Person(String name, Integer age){}
public static void main(String[] args) {
Person.of();
}Another interesting thing is why IDEA resolves empty methods on allArgs)
And1sS, yevhenii-viktorov, marki1an, Net-burst, swaranga and 20 more
Metadata
Metadata
Assignees
Labels
No labels