Polish ternary expressions
Consistently format ternary expressions and always favor `!=` as the the check.
This commit is contained in:
@@ -423,7 +423,7 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
|
||||
this.metadataCollector.add(ItemMetadata.newProperty(endpointKey, "enabled",
|
||||
Boolean.class.getName(), type, null,
|
||||
String.format("Whether to enable the %s endpoint.", endpointId),
|
||||
(enabledByDefault == null ? true : enabledByDefault), null));
|
||||
(enabledByDefault != null ? enabledByDefault : true), null));
|
||||
if (hasMainReadOperation(element)) {
|
||||
this.metadataCollector.add(ItemMetadata.newProperty(endpointKey,
|
||||
"cache.time-to-live", Duration.class.getName(), type, null,
|
||||
|
||||
@@ -178,7 +178,7 @@ public class JavaCompilerFieldValuesParser implements FieldValuesParser {
|
||||
String type = instance.toString();
|
||||
type = type.substring(DURATION_OF.length(), type.indexOf('('));
|
||||
String suffix = DURATION_SUFFIX.get(type);
|
||||
return (suffix == null ? null : factoryValue + suffix);
|
||||
return (suffix != null ? factoryValue + suffix : null);
|
||||
}
|
||||
return factoryValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user