Browse Source

Merge branch '2.7.x'

Closes gh-32146
pull/32176/head
Stephane Nicoll 4 years ago
parent
commit
d637fe37cc
  1. 8
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/netty/NettyProperties.java
  2. 4
      spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  3. 7
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/netty/NettyPropertiesTests.java

8
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/netty/NettyProperties.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -30,9 +30,11 @@ import org.springframework.boot.context.properties.ConfigurationProperties; @@ -30,9 +30,11 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
public class NettyProperties {
/**
* Level of leak detection for reference-counted buffers.
* Level of leak detection for reference-counted buffers. If not configured via
* 'ResourceLeakDetector.setLevel' or the 'io.netty.leakDetection.level' system
* property, default to 'simple'.
*/
private LeakDetection leakDetection = LeakDetection.SIMPLE;
private LeakDetection leakDetection;
public LeakDetection getLeakDetection() {
return this.leakDetection;

4
spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@ -2105,10 +2105,6 @@ @@ -2105,10 +2105,6 @@
"name": "spring.neo4j.uri",
"defaultValue": "bolt://localhost:7687"
},
{
"name": "spring.netty.leak-detection",
"defaultValue": "simple"
},
{
"name": "spring.quartz.jdbc.comment-prefix",
"defaultValue": [

7
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/netty/NettyPropertiesTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -32,11 +32,10 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -32,11 +32,10 @@ import static org.assertj.core.api.Assertions.assertThat;
class NettyPropertiesTests {
@Test
void defaultValueShouldMatchNettys() {
NettyProperties properties = new NettyProperties();
void defaultValueShouldBeConsistent() {
ResourceLeakDetector.Level defaultLevel = (Level) ReflectionTestUtils.getField(ResourceLeakDetector.class,
"DEFAULT_LEVEL");
assertThat(ResourceLeakDetector.Level.valueOf(properties.getLeakDetection().name())).isEqualTo(defaultLevel);
assertThat(defaultLevel).isEqualTo(Level.SIMPLE);
}
}

Loading…
Cancel
Save