Browse Source

Polish

pull/39276/head
Phillip Webb 2 years ago
parent
commit
088b313ae5
  1. 1
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/session/ReactiveSessionsEndpointTests.java
  2. 11
      spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessor.java

1
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/session/ReactiveSessionsEndpointTests.java

@ -68,7 +68,6 @@ class ReactiveSessionsEndpointTests { @@ -68,7 +68,6 @@ class ReactiveSessionsEndpointTests {
assertThat(result.get(0).getLastAccessedTime()).isEqualTo(session.getLastAccessedTime());
assertThat(result.get(0).getMaxInactiveInterval()).isEqualTo(session.getMaxInactiveInterval().getSeconds());
assertThat(result.get(0).isExpired()).isEqualTo(session.isExpired());
}).expectComplete().verify(Duration.ofSeconds(1));
then(this.indexedSessionRepository).should().findByPrincipalName("user");
}

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

@ -307,13 +307,12 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor @@ -307,13 +307,12 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
private void checkEnabledValueMatchesExisting(ItemMetadata existing, boolean enabledByDefault, String sourceType) {
boolean existingDefaultValue = (boolean) existing.getDefaultValue();
if (enabledByDefault == existingDefaultValue) {
return;
if (enabledByDefault != existingDefaultValue) {
throw new IllegalStateException(
"Existing property '%s' from type %s has a conflicting value. Existing value: %b, new value from type %s: %b"
.formatted(existing.getName(), existing.getSourceType(), existingDefaultValue, sourceType,
enabledByDefault));
}
throw new IllegalStateException(
"Existing property '%s' from type %s has a conflicting value. Existing value: %b, new value from type %s: %b"
.formatted(existing.getName(), existing.getSourceType(), existingDefaultValue, sourceType,
enabledByDefault));
}
private boolean hasMainReadOperation(TypeElement element) {

Loading…
Cancel
Save