Closed
Description
Affects: 5.1.6 / 4.3.23 + Spring Tools 4.2.0
@Component
public class PropertiesTest {
@Value("${key}")
String property;
@Value("${key}")
String[] propertyArr;
}
If a property key
is defined without a value in application.properties (i.e. key=
) the variable property
is initialized with an empty String and propertyArr
with an empty String array.
If key
is defined without a value in a 'Spring Boot App' Eclipse launch configuration instead ("Override Properties" feature) the start of the application fails:
java.lang.IllegalArgumentException: Could not resolve placeholder 'key' in value "${key}"
Spring should always resolve a property with an empty value as an empty String / String array.