Polish ternary expressions

Consistently format ternary expressions and always favor `!=` as the
the check.
This commit is contained in:
Phillip Webb
2018-05-03 13:08:20 -07:00
parent bbf94c22da
commit 41efea51a7
128 changed files with 285 additions and 257 deletions

View File

@@ -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,

View File

@@ -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;
}