Retain default LocalVariableTableParameterNameDiscoverer with warn log entries

For a transition period, LocalVariableTableParameterNameDiscoverer logs a warning for each successful resolution attempt now, suggesting that -parameters was missed.

See gh-29531
See gh-29559
This commit is contained in:
Juergen Hoeller
2022-11-23 10:31:43 +01:00
parent ed5ab77397
commit fe5bd6751f
5 changed files with 25 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-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.
@@ -34,7 +34,8 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
class LocalVariableTableParameterNameDiscovererTests {
private final LocalVariableTableParameterNameDiscoverer discoverer = new LocalVariableTableParameterNameDiscoverer();
@SuppressWarnings("removal")
private final ParameterNameDiscoverer discoverer = new LocalVariableTableParameterNameDiscoverer();
@Test

View File

@@ -16,7 +16,6 @@
package org.springframework.core;
import java.lang.reflect.Method;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
@@ -28,7 +27,6 @@ import reactor.blockhound.BlockHound;
import reactor.core.scheduler.ReactorBlockHoundIntegration;
import reactor.core.scheduler.Schedulers;
import org.springframework.tests.sample.objects.TestObject;
import org.springframework.util.ConcurrentReferenceHashMap;
import static org.assertj.core.api.Assertions.assertThat;
@@ -52,11 +50,10 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
@DisabledOnJre(value= {JRE.JAVA_18, JRE.JAVA_19}, disabledReason = "BlockHound is not compatible with Java 18+")
class SpringCoreBlockHoundIntegrationTests {
@BeforeAll
static void setUp() {
static void setup() {
BlockHound.builder()
.with(new ReactorBlockHoundIntegration()) // Reactor non-blocking thread predicate
.with(new ReactorBlockHoundIntegration()) // Reactor non-blocking thread predicate
.with(new ReactiveAdapterRegistry.SpringCoreBlockHoundIntegration())
.install();
}
@@ -68,15 +65,6 @@ class SpringCoreBlockHoundIntegrationTests {
.hasMessageContaining("Blocking call!");
}
@Test
void localVariableTableParameterNameDiscoverer() {
testNonBlockingTask(() -> {
Method setName = TestObject.class.getMethod("setName", String.class);
String[] names = new LocalVariableTableParameterNameDiscoverer().getParameterNames(setName);
assertThat(names).containsExactly("name");
});
}
@Test
void concurrentReferenceHashMap() {
int size = 10000;