Browse Source

Polishing

pull/32173/head
Juergen Hoeller 2 years ago
parent
commit
f22bdf4734
  1. 4
      spring-context/src/main/java/org/springframework/context/SmartLifecycle.java
  2. 11
      spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionContext.java
  3. 4
      spring-web/src/main/java/org/springframework/http/server/reactive/ChannelSendOperator.java
  4. 7
      spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java
  5. 5
      spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java

4
spring-context/src/main/java/org/springframework/context/SmartLifecycle.java

@ -1,5 +1,5 @@ @@ -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 { @@ -121,7 +121,7 @@ public interface SmartLifecycle extends Lifecycle, Phased {
/**
* Return the phase that this lifecycle object is supposed to run in.
* <p>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()

11
spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionContext.java

@ -1,5 +1,5 @@ @@ -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.
@ -39,7 +39,8 @@ import org.springframework.util.function.SingletonSupplier; @@ -39,7 +39,8 @@ import org.springframework.util.function.SingletonSupplier;
*/
public class TransactionContext {
private final @Nullable TransactionContext parent;
@Nullable
private final TransactionContext parent;
private final SingletonSupplier<UUID> contextId = SingletonSupplier.of(UUID::randomUUID);
@ -48,11 +49,13 @@ public class TransactionContext { @@ -48,11 +49,13 @@ public class TransactionContext {
@Nullable
private Set<TransactionSynchronization> 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;

4
spring-web/src/main/java/org/springframework/http/server/reactive/ChannelSendOperator.java

@ -1,5 +1,5 @@ @@ -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.
@ -39,7 +39,7 @@ import org.springframework.util.Assert; @@ -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

7
spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2023 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.
@ -157,13 +157,14 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport @@ -157,13 +157,14 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
* @param patternParser the parser to use
* @since 5.3
*/
public void setPatternParser(PathPatternParser patternParser) {
public void setPatternParser(@Nullable PathPatternParser patternParser) {
this.patternParser = patternParser;
}
/**
* Return the {@link #setPatternParser(PathPatternParser) configured}
* {@code PathPatternParser}, or {@code null}.
* {@code PathPatternParser}, or {@code null} otherwise which indicates that
* String pattern matching with {@link AntPathMatcher} is enabled instead.
* @since 5.3
*/
@Nullable

5
spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java

@ -1,5 +1,5 @@ @@ -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.
@ -102,7 +102,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap @@ -102,7 +102,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
@Override
public void setPatternParser(PathPatternParser patternParser) {
public void setPatternParser(@Nullable PathPatternParser patternParser) {
Assert.state(this.mappingRegistry.getRegistrations().isEmpty(),
"PathPatternParser must be set before the initialization of " +
"request mappings through InitializingBean#afterPropertiesSet.");
@ -567,6 +567,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap @@ -567,6 +567,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
/**
* A registry that maintains all mappings to handler methods, exposing methods
* to perform lookups and providing concurrent access.
*
* <p>Package-private for testing purposes.
*/
class MappingRegistry {

Loading…
Cancel
Save