Browse Source

Merge branch '2.6.x' into 2.7.x

Closes gh-32145
pull/32861/head
Stephane Nicoll 4 years ago
parent
commit
7a91fa90d5
  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 @@
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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;
public class NettyProperties { 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() { public LeakDetection getLeakDetection() {
return this.leakDetection; return this.leakDetection;

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

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

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

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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;
class NettyPropertiesTests { class NettyPropertiesTests {
@Test @Test
void defaultValueShouldMatchNettys() { void defaultValueShouldBeConsistent() {
NettyProperties properties = new NettyProperties();
ResourceLeakDetector.Level defaultLevel = (Level) ReflectionTestUtils.getField(ResourceLeakDetector.class, ResourceLeakDetector.Level defaultLevel = (Level) ReflectionTestUtils.getField(ResourceLeakDetector.class,
"DEFAULT_LEVEL"); "DEFAULT_LEVEL");
assertThat(ResourceLeakDetector.Level.valueOf(properties.getLeakDetection().name())).isEqualTo(defaultLevel); assertThat(defaultLevel).isEqualTo(Level.SIMPLE);
} }
} }

Loading…
Cancel
Save