- Java
- java:S6857
- SonarQube Server Enterprise Edition v10.8.1 (101195)
I have a spring boot project
in properties file I have
app.pagination.limit=10
provider.attribute_map={\
'givenname': 'firstName', \
'sn': 'lastName' \
}
In a Java class
@Value("#{T(java.lang.Math).min(50, ${app.pagination.limit})}")
private int paginationLimit;
@Value("#{${provider.attribute_map:T(java.util.Collections).emptyMap()}}")
Map<String, String> attributeMap;
The SPEL is properly evaluated assigning the variable to 10, but sonar is reporting “Correct this malformed SpEL expression.”