From c6684731865e5699a28f30353157ef1dcbe02b17 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 19 Jan 2024 17:18:28 +0100 Subject: [PATCH] Polishing --- .../org/springframework/context/SmartLifecycle.java | 4 ++-- .../PersistenceManagedTypesScanner.java | 7 ++++++- .../transaction/reactive/TransactionContext.java | 11 +++++++---- .../http/server/reactive/ChannelSendOperator.java | 4 ++-- .../servlet/handler/AbstractHandlerMethodMapping.java | 3 ++- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/SmartLifecycle.java b/spring-context/src/main/java/org/springframework/context/SmartLifecycle.java index 06f98a4048..5ad500d1b2 100644 --- a/spring-context/src/main/java/org/springframework/context/SmartLifecycle.java +++ b/spring-context/src/main/java/org/springframework/context/SmartLifecycle.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 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. @@ -121,7 +121,7 @@ public interface SmartLifecycle extends Lifecycle, Phased { /** * Return the phase that this lifecycle object is supposed to run in. *

The default implementation returns {@link #DEFAULT_PHASE} in order to - * let {@code stop()} callbacks execute after regular {@code Lifecycle} + * let {@code stop()} callbacks execute before regular {@code Lifecycle} * implementations. * @see #isAutoStartup() * @see #start() diff --git a/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/PersistenceManagedTypesScanner.java b/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/PersistenceManagedTypesScanner.java index 48b5d11fa6..09649fe161 100644 --- a/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/PersistenceManagedTypesScanner.java +++ b/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/PersistenceManagedTypesScanner.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 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. @@ -73,11 +73,16 @@ public final class PersistenceManagedTypesScanner { private final CandidateComponentsIndex componentsIndex; + /** + * Create a new {@code PersistenceManagedTypesScanner} for the given resource loader. + * @param resourceLoader the {@code ResourceLoader} to use + */ public PersistenceManagedTypesScanner(ResourceLoader resourceLoader) { this.resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader); this.componentsIndex = CandidateComponentsIndexLoader.loadIndex(resourceLoader.getClassLoader()); } + /** * Scan the specified packages and return a {@link PersistenceManagedTypes} that * represents the result of the scanning. diff --git a/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionContext.java b/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionContext.java index 3fe4ad088d..9a6c191a91 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionContext.java +++ b/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 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. @@ -36,18 +36,21 @@ import org.springframework.lang.Nullable; */ public class TransactionContext { - private final @Nullable TransactionContext parent; + @Nullable + private final TransactionContext parent; private final Map resources = new LinkedHashMap<>(); @Nullable private Set synchronizations; - private volatile @Nullable String currentTransactionName; + @Nullable + private volatile String currentTransactionName; private volatile boolean currentTransactionReadOnly; - private volatile @Nullable Integer currentTransactionIsolationLevel; + @Nullable + private volatile Integer currentTransactionIsolationLevel; private volatile boolean actualTransactionActive; diff --git a/spring-web/src/main/java/org/springframework/http/server/reactive/ChannelSendOperator.java b/spring-web/src/main/java/org/springframework/http/server/reactive/ChannelSendOperator.java index 63c4033a78..abf0b6ab8f 100644 --- a/spring-web/src/main/java/org/springframework/http/server/reactive/ChannelSendOperator.java +++ b/spring-web/src/main/java/org/springframework/http/server/reactive/ChannelSendOperator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 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. @@ -39,7 +39,7 @@ import org.springframework.util.Assert; * to defer the invocation of the write function, until we know if the source * publisher will begin publishing without an error. If the first emission is * an error, the write function is bypassed, and the error is sent directly - * through the result publisher. Otherwise the write function is invoked. + * through the result publisher. Otherwise, the write function is invoked. * * @author Rossen Stoyanchev * @author Stephane Maldini diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java index f9f5c68e42..554e0fe8dc 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 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. @@ -565,6 +565,7 @@ public abstract class AbstractHandlerMethodMapping extends AbstractHandlerMap /** * A registry that maintains all mappings to handler methods, exposing methods * to perform lookups and providing concurrent access. + * *

Package-private for testing purposes. */ class MappingRegistry {