Skip to content

Commit 05d9b52

Browse files
committed
Polishing
1 parent 59a125d commit 05d9b52

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBeanRuntimeHints.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -37,7 +37,7 @@ class SchedulerFactoryBeanRuntimeHints implements RuntimeHintsRegistrar {
3737

3838
private static final String SCHEDULER_FACTORY_CLASS_NAME = "org.quartz.impl.StdSchedulerFactory";
3939

40-
private final ReflectiveRuntimeHintsRegistrar reflectiveRegistrar = new ReflectiveRuntimeHintsRegistrar();
40+
private static final ReflectiveRuntimeHintsRegistrar registrar = new ReflectiveRuntimeHintsRegistrar();
4141

4242

4343
@Override
@@ -49,7 +49,7 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
4949
.registerType(TypeReference.of(SCHEDULER_FACTORY_CLASS_NAME), this::typeHint)
5050
.registerTypes(TypeReference.listOf(ResourceLoaderClassLoadHelper.class,
5151
LocalTaskExecutorThreadPool.class, LocalDataSourceJobStore.class), this::typeHint);
52-
this.reflectiveRegistrar.registerRuntimeHints(hints, LocalTaskExecutorThreadPool.class);
52+
registrar.registerRuntimeHints(hints, LocalTaskExecutorThreadPool.class);
5353
}
5454

5555
private void typeHint(Builder typeHint) {

spring-context/src/main/java/org/springframework/context/aot/ReflectiveProcessorBeanFactoryInitializationAotProcessor.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -39,7 +39,8 @@
3939
*/
4040
class ReflectiveProcessorBeanFactoryInitializationAotProcessor implements BeanFactoryInitializationAotProcessor {
4141

42-
private static final ReflectiveRuntimeHintsRegistrar REGISTRAR = new ReflectiveRuntimeHintsRegistrar();
42+
private static final ReflectiveRuntimeHintsRegistrar registrar = new ReflectiveRuntimeHintsRegistrar();
43+
4344

4445
@Override
4546
public BeanFactoryInitializationAotContribution processAheadOfTime(ConfigurableListableBeanFactory beanFactory) {
@@ -49,7 +50,9 @@ public BeanFactoryInitializationAotContribution processAheadOfTime(ConfigurableL
4950
return new ReflectiveProcessorBeanFactoryInitializationAotContribution(beanTypes);
5051
}
5152

52-
private static class ReflectiveProcessorBeanFactoryInitializationAotContribution implements BeanFactoryInitializationAotContribution {
53+
54+
private static class ReflectiveProcessorBeanFactoryInitializationAotContribution
55+
implements BeanFactoryInitializationAotContribution {
5356

5457
private final Class<?>[] types;
5558

@@ -60,9 +63,8 @@ public ReflectiveProcessorBeanFactoryInitializationAotContribution(Class<?>[] ty
6063
@Override
6164
public void applyTo(GenerationContext generationContext, BeanFactoryInitializationCode beanFactoryInitializationCode) {
6265
RuntimeHints runtimeHints = generationContext.getRuntimeHints();
63-
REGISTRAR.registerRuntimeHints(runtimeHints, this.types);
66+
registrar.registerRuntimeHints(runtimeHints, this.types);
6467
}
65-
6668
}
6769

6870
}

spring-core/src/main/java/org/springframework/aot/hint/annotation/Reflective.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -39,8 +39,7 @@
3939
* @see ReflectiveRuntimeHintsRegistrar
4040
* @see RegisterReflectionForBinding @RegisterReflectionForBinding
4141
*/
42-
@Target({ ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.CONSTRUCTOR,
43-
ElementType.FIELD, ElementType.METHOD })
42+
@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD})
4443
@Retention(RetentionPolicy.RUNTIME)
4544
@Documented
4645
public @interface Reflective {

spring-core/src/main/java/org/springframework/aot/hint/annotation/RegisterReflectionForBinding.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*
3737
* <pre class="code">
3838
* &#064;Configuration
39-
* &#064;RegisterReflectionForBinding({ Foo.class, Bar.class })
39+
* &#064;RegisterReflectionForBinding({Foo.class, Bar.class})
4040
* public class MyConfig {
4141
* // ...
4242
* }</pre>
@@ -78,7 +78,7 @@
7878
/**
7979
* Classes for which reflection hints should be registered.
8080
* <p>At least one class must be specified either via {@link #value} or
81-
* {@link #classes}.
81+
* {@code #classes}.
8282
* @see #value()
8383
*/
8484
@AliasFor("value")

spring-web/src/main/java/org/springframework/web/client/NoOpResponseErrorHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public boolean hasError(ClientHttpResponse response) throws IOException {
3636

3737
@Override
3838
public void handleError(ClientHttpResponse response) throws IOException {
39-
39+
// never actually called
4040
}
4141

4242
}

spring-web/src/main/java/org/springframework/web/filter/ForwardedHeaderFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -340,6 +340,7 @@ public int getRemotePort() {
340340

341341
@SuppressWarnings("DataFlowIssue")
342342
@Override
343+
@Nullable
343344
public Object getAttribute(String name) {
344345
if (name.equals(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE)) {
345346
return this.forwardedPrefixExtractor.getErrorRequestUri();
@@ -480,7 +481,6 @@ private static class ForwardedHeaderExtractingResponse extends HttpServletRespon
480481

481482
@Override
482483
public void sendRedirect(String location) throws IOException {
483-
484484
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(location);
485485
UriComponents uriComponents = builder.build();
486486

0 commit comments

Comments
 (0)