
|
If you were logged in you would be able to see more operations.
|
|
|
|
Map config = System.getProperties();
Object setting = config.get(AUTO_ANNOTATION_PROCESSING);
if (extenderConfiguration.shouldProcessAnnotation()
|| (setting != null && setting instanceof String && Boolean.getBoolean((String) setting))) {
Why properties are retrieved into Map and then there is a check for instanceof and casting. . .?
According to Javadoc, Boolean.getBoolean((String) setting) - is not parsing the String argument as boolean, but uses the argument as the name to pull the System property. If we still need to parse the argument into boolean use parseBoolean(..) method.
However it looks like all we need is AUTO_ANNOTATION_PROCESSING system property which means that the code above could be as simple as:
if (extenderConfiguration.shouldProcessAnnotation() || Boolean.getBoolean(AUTO_ANNOTATION_PROCESSING)){
. . . . .
If System property is null, then getBoolean method will return false (no need to check for null)
. . .
|
|
Description
|
Map config = System.getProperties();
Object setting = config.get(AUTO_ANNOTATION_PROCESSING);
if (extenderConfiguration.shouldProcessAnnotation()
|| (setting != null && setting instanceof String && Boolean.getBoolean((String) setting))) {
Why properties are retrieved into Map and then there is a check for instanceof and casting. . .?
According to Javadoc, Boolean.getBoolean((String) setting) - is not parsing the String argument as boolean, but uses the argument as the name to pull the System property. If we still need to parse the argument into boolean use parseBoolean(..) method.
However it looks like all we need is AUTO_ANNOTATION_PROCESSING system property which means that the code above could be as simple as:
if (extenderConfiguration.shouldProcessAnnotation() || Boolean.getBoolean(AUTO_ANNOTATION_PROCESSING)){
. . . . .
If System property is null, then getBoolean method will return false (no need to check for null)
. . . |
Show » |
| There are no comments yet on this issue.
|
|