Hi,
I use @FieldNameConstants in order to made enum values available for @RolesAllowed in Spring Boot apps.
After migrating to from Java21 to Java25 there are compile errors complaining about the use of those annotations:
Symbol not found
8516 [ERROR] Symbol: Variable Fields
'Fields' is the variable provided by Lombok.
This is the enum class:
@FieldNameConstants(onlyExplicitlyIncluded = true)
public enum Roles {
@FieldNameConstants.Include AL_SB,
@FieldNameConstants.Include AL_WW
}
This is how I use the generated constants fields:
@RolesAllowed({Roles.Fields.AL_SB, Roles.Fields.AL_WW})
I have already tried to define the used inner field name (default 'Fields') explicitely:
@FieldNameConstants(onlyExplicitlyIncluded = true, innerTypeName = "Fields")
without success.
Is this i known problem ?
Furthermore its strange the the compile error only occure on the commandline using mvn compile by using the Java25 set by sdk (MacOS with zsh).
The VSCode project compiles without an error but I'm not sure, whether VSCode really use Java25 ?
Kind regards
Dominik