Skip to content

Commit bba6642

Browse files
committed
Polishing
1 parent 0f8ca80 commit bba6642

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@
111111
*/
112112
public class GenericApplicationContext extends AbstractApplicationContext implements BeanDefinitionRegistry {
113113

114-
private static final Consumer<Builder> asCglibProxy = hint ->
114+
private static final Consumer<Builder> asClassBasedProxy = hint ->
115115
hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
116116
MemberCategory.INVOKE_DECLARED_METHODS,
117117
MemberCategory.DECLARED_FIELDS);
118118

119-
private static final Consumer<Builder> asCglibProxyTarget = hint ->
119+
private static final Consumer<Builder> asProxiedUserClass = hint ->
120120
hint.withMembers(MemberCategory.INTROSPECT_DECLARED_CONSTRUCTORS,
121121
MemberCategory.INVOKE_DECLARED_METHODS);
122122

@@ -445,14 +445,16 @@ private void preDetermineBeanTypes(RuntimeHints runtimeHints) {
445445
for (SmartInstantiationAwareBeanPostProcessor bpp : bpps) {
446446
beanType = bpp.determineBeanType(beanType, beanName);
447447
if (Proxy.isProxyClass(beanType)) {
448+
// A JDK proxy class needs an explicit hint
448449
runtimeHints.proxies().registerJdkProxy(beanType.getInterfaces());
449450
}
450451
else {
452+
// Potentially a CGLIB-generated subclass with reflection hints
451453
Class<?> userClass = ClassUtils.getUserClass(beanType);
452454
if (userClass != beanType) {
453455
runtimeHints.reflection()
454-
.registerType(beanType, asCglibProxy)
455-
.registerType(userClass, asCglibProxyTarget);
456+
.registerType(beanType, asClassBasedProxy)
457+
.registerType(userClass, asProxiedUserClass);
456458
}
457459
}
458460
}

spring-core/src/test/java/org/springframework/core/task/SimpleAsyncTaskExecutorTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
class SimpleAsyncTaskExecutorTests {
3333

3434
@Test
35-
void cannotExecuteWhenConcurrencyIsSwitchedOff() throws Exception {
35+
void cannotExecuteWhenConcurrencyIsSwitchedOff() {
3636
SimpleAsyncTaskExecutor executor = new SimpleAsyncTaskExecutor();
3737
executor.setConcurrencyLimit(ConcurrencyThrottleSupport.NO_CONCURRENCY);
3838
assertThat(executor.isThrottleActive()).isTrue();
@@ -41,13 +41,13 @@ void cannotExecuteWhenConcurrencyIsSwitchedOff() throws Exception {
4141
}
4242

4343
@Test
44-
void throttleIsNotActiveByDefault() throws Exception {
44+
void throttleIsNotActiveByDefault() {
4545
SimpleAsyncTaskExecutor executor = new SimpleAsyncTaskExecutor();
4646
assertThat(executor.isThrottleActive()).as("Concurrency throttle must not default to being active (on)").isFalse();
4747
}
4848

4949
@Test
50-
void threadNameGetsSetCorrectly() throws Exception {
50+
void threadNameGetsSetCorrectly() {
5151
final String customPrefix = "chankPop#";
5252
final Object monitor = new Object();
5353
SimpleAsyncTaskExecutor executor = new SimpleAsyncTaskExecutor(customPrefix);
@@ -57,7 +57,7 @@ void threadNameGetsSetCorrectly() throws Exception {
5757
}
5858

5959
@Test
60-
void threadFactoryOverridesDefaults() throws Exception {
60+
void threadFactoryOverridesDefaults() {
6161
final Object monitor = new Object();
6262
SimpleAsyncTaskExecutor executor = new SimpleAsyncTaskExecutor(runnable -> new Thread(runnable, "test"));
6363
ThreadNameHarvester task = new ThreadNameHarvester(monitor);
@@ -66,7 +66,7 @@ void threadFactoryOverridesDefaults() throws Exception {
6666
}
6767

6868
@Test
69-
void throwsExceptionWhenSuppliedWithNullRunnable() throws Exception {
69+
void throwsExceptionWhenSuppliedWithNullRunnable() {
7070
assertThatIllegalArgumentException().isThrownBy(() ->
7171
new SimpleAsyncTaskExecutor().execute(null));
7272
}

spring-web/src/main/java/org/springframework/http/RequestEntity.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,6 @@
2828
import org.springframework.lang.Nullable;
2929
import org.springframework.util.MultiValueMap;
3030
import org.springframework.util.ObjectUtils;
31-
import org.springframework.web.util.UriTemplateHandler;
3231

3332
/**
3433
* Extension of {@link HttpEntity} that also exposes the HTTP method and the
@@ -167,7 +166,7 @@ public HttpMethod getMethod() {
167166
* on how to expand template and encode the URI. In such cases, the
168167
* {@code URI} is prepared by the
169168
* {@link org.springframework.web.client.RestTemplate} with the help of the
170-
* {@link UriTemplateHandler} it is configured with.
169+
* {@link org.springframework.web.util.UriTemplateHandler} it is configured with.
171170
*/
172171
public URI getUrl() {
173172
if (this.url == null) {

0 commit comments

Comments
 (0)