Skip to content

Commit e531134

Browse files
Simplify condition
1 parent 50d0519 commit e531134

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ private boolean isUsingTestDatasourceUrl() {
214214
List<ConfigurationProperty> bound = new ArrayList<>();
215215
Binder.get(this.environment, new BoundPropertiesTrackingBindHandler(bound::add))
216216
.bind(DATASOURCE_URL_PROPERTY, BINDABLE_STRING);
217-
return (!bound.isEmpty()) ? isUsingTestDatasourceUrl(bound.get(0)) : false;
217+
return !bound.isEmpty() && isUsingTestDatasourceUrl(bound.get(0));
218218
}
219219

220220
private boolean isUsingTestDatasourceUrl(ConfigurationProperty configurationProperty) {

spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ private void processEndpoint(AnnotationMirror annotation, TypeElement element) {
303303
boolean enabledByDefaultAttribute = (boolean) elementValues.getOrDefault("enableByDefault", true);
304304
String defaultAccess = (!enabledByDefaultAttribute) ? "none"
305305
: (elementValues.getOrDefault("defaultAccess", "unrestricted").toString()).toLowerCase(Locale.ENGLISH);
306-
boolean enabledByDefault = "none".equals(defaultAccess) ? false : enabledByDefaultAttribute;
306+
boolean enabledByDefault = !"none".equals(defaultAccess) && enabledByDefaultAttribute;
307307
String type = this.metadataEnv.getTypeUtils().getQualifiedName(element);
308308
this.metadataCollector.addIfAbsent(ItemMetadata.newGroup(endpointKey, type, type, null));
309309
ItemMetadata accessProperty = ItemMetadata.newProperty(endpointKey, "access", endpointAccessEnum(), type, null,

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringEnvironmentPropertySource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public String getProperty(String key) {
4848
@Override
4949
public boolean containsProperty(String key) {
5050
Environment environment = this.environment;
51-
return (environment != null) ? environment.containsProperty(key) : false;
51+
return environment != null && environment.containsProperty(key);
5252
}
5353

5454
void setEnvironment(Environment environment) {

0 commit comments

Comments
 (0)