-
Story
-
Resolution: Done
-
Minor
-
DO378 - RHBoQ1.11-en-1-20210930
-
None
-
ILT, ROLE, VT
-
en-US (English)
URL:
Reporter RHNID:
Section: -
Language: en-US (English)||
Workaround:
Description: In the student guide, there is a config property file using the example prefix, explaining how ConfigProperties can be used instead of ConfigProperty:
The above example could be refactored to use the @ConfigProperties annotation. First, you must add an example prefix to the names of your configuration values in application.properties, like the following:
example.format=One format for %s unit.
example.unit=meter
example.debugFlag=true
Then, in the below code sample, the class field is named the same, but the text underneath states that debug-flag would have been converted to debugFlag, causing confusion:
public class ExampleConfiguration {
private String format;
private boolean debugFlag = false;
private Optional<String> unit;
...output omitted...
In this case, in the configuration, the debug-flag variable will have its hyphen translated into setting the following letter into an uppercase, mapping it to debugFlag.
I have not tested, but it makes sense that debug-flag is mapped, because it is a valid property name, but not a valid Java field name.
The book needs a fix in that area though.