Skip to content

Commit 3881a4a

Browse files
committed
Polishing
1 parent 3899b7a commit 3881a4a

File tree

39 files changed

+133
-147
lines changed

39 files changed

+133
-147
lines changed

spring-core/src/main/java/org/springframework/core/codec/Hints.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.core.codec;
1718

1819
import java.util.Collections;
@@ -34,15 +35,13 @@ public abstract class Hints {
3435

3536
/**
3637
* Name of hint exposing a prefix to use for correlating log messages.
37-
* @since 5.1
3838
*/
3939
public static final String LOG_PREFIX_HINT = Log.class.getName() + ".PREFIX";
4040

4141
/**
4242
* Name of boolean hint whether to avoid logging data either because it's
4343
* potentially sensitive, or because it has been logged by a composite
4444
* encoder, e.g. for multipart requests.
45-
* @since 5.1
4645
*/
4746
public static final String SUPPRESS_LOGGING_HINT = Log.class.getName() + ".SUPPRESS_LOGGING";
4847

@@ -91,7 +90,7 @@ public static <T> T getRequiredHint(@Nullable Map<String, Object> hints, String
9190
* @return the log prefix
9291
*/
9392
public static String getLogPrefix(@Nullable Map<String, Object> hints) {
94-
return hints != null ? (String) hints.getOrDefault(LOG_PREFIX_HINT, "") : "";
93+
return (hints != null ? (String) hints.getOrDefault(LOG_PREFIX_HINT, "") : "");
9594
}
9695

9796
/**
@@ -100,7 +99,7 @@ public static String getLogPrefix(@Nullable Map<String, Object> hints) {
10099
* @return whether logging of data is allowed
101100
*/
102101
public static boolean isLoggingSuppressed(@Nullable Map<String, Object> hints) {
103-
return hints != null && (boolean) hints.getOrDefault(SUPPRESS_LOGGING_HINT, false);
102+
return (hints != null && (boolean) hints.getOrDefault(SUPPRESS_LOGGING_HINT, false));
104103
}
105104

106105
/**

spring-core/src/main/java/org/springframework/core/env/Profiles.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,26 @@ public interface Profiles {
3939
*/
4040
boolean matches(Predicate<String> activeProfiles);
4141

42+
4243
/**
4344
* Create a new {@link Profiles} instance that checks for matches against
4445
* the given <em>profile strings</em>.
45-
*
4646
* <p>The returned instance will {@linkplain Profiles#matches(Predicate) match}
4747
* if any one of the given profile strings matches.
48-
*
4948
* <p>A profile string may contain a simple profile name (for example
5049
* {@code "production"}) or a profile expression. A profile expression allows
5150
* for more complicated profile logic to be expressed, for example
5251
* {@code "production & cloud"}.
53-
*
5452
* <p>The following operators are supported in profile expressions:
5553
* <ul>
5654
* <li>{@code !} - A logical <em>not</em> of the profile</li>
5755
* <li>{@code &} - A logical <em>and</em> of the profiles</li>
5856
* <li>{@code |} - A logical <em>or</em> of the profiles</li>
5957
* </ul>
60-
*
6158
* <p>Please note that the {@code &} and {@code |} operators may not be mixed
6259
* without using parentheses. For example {@code "a & b | c"} is not a valid
6360
* expression; it must be expressed as {@code "(a & b) | c"} or
6461
* {@code "a & (b | c)"}.
65-
*
6662
* @param profiles the <em>profile strings</em> to include
6763
* @return a new {@link Profiles} instance
6864
*/

spring-messaging/src/main/java/org/springframework/messaging/simp/broker/AbstractBrokerMessageHandler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,6 @@ public Collection<String> getDestinationPrefixes() {
129129
return this.destinationPrefixes;
130130
}
131131

132-
@Override
133-
public void setApplicationEventPublisher(@Nullable ApplicationEventPublisher publisher) {
134-
this.eventPublisher = publisher;
135-
}
136-
137132
/**
138133
* Whether the client must receive messages in the order of publication.
139134
* <p>By default messages sent to the {@code "clientOutboundChannel"} may
@@ -159,6 +154,11 @@ public boolean isPreservePublishOrder() {
159154
return this.preservePublishOrder;
160155
}
161156

157+
@Override
158+
public void setApplicationEventPublisher(@Nullable ApplicationEventPublisher publisher) {
159+
this.eventPublisher = publisher;
160+
}
161+
162162
@Nullable
163163
public ApplicationEventPublisher getApplicationEventPublisher() {
164164
return this.eventPublisher;

spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 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.

spring-test/src/main/java/org/springframework/mock/web/server/MockServerWebExchange.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.mock.web.server;
1718

1819
import reactor.core.publisher.Mono;
@@ -38,7 +39,6 @@
3839
*/
3940
public final class MockServerWebExchange extends DefaultServerWebExchange {
4041

41-
4242
private MockServerWebExchange(MockServerHttpRequest request, WebSessionManager sessionManager) {
4343
super(request, new MockServerHttpResponse(), sessionManager,
4444
ServerCodecConfigurer.create(), new AcceptHeaderLocaleContextResolver());
@@ -101,12 +101,10 @@ public static class Builder {
101101
@Nullable
102102
private WebSessionManager sessionManager;
103103

104-
105104
public Builder(MockServerHttpRequest request) {
106105
this.request = request;
107106
}
108107

109-
110108
/**
111109
* Set the session to use for the exchange.
112110
* <p>This method is mutually exclusive with

spring-test/src/main/java/org/springframework/test/web/servlet/MockMvc.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,14 @@ void setGlobalResultHandlers(List<ResultHandler> resultHandlers) {
123123
this.defaultResultHandlers = resultHandlers;
124124
}
125125

126-
127126
/**
128127
* Return the underlying {@link DispatcherServlet} instance that this
129128
* {@code MockMvc} was initialized with.
130-
* <p>This is intended for use in custom request processing scenario where
131-
* a request handling component happens to delegate to the
132-
* {@code DispatcherServlet} at runtime and therefore needs to be injected
133-
* with it.
134-
* <p>For most processing scenarios, simply use {@link MockMvc#perform}, or
135-
* if you need to configure the {@code DispatcherServlet}, provide a
129+
* <p>This is intended for use in custom request processing scenario where a
130+
* request handling component happens to delegate to the {@code DispatcherServlet}
131+
* at runtime and therefore needs to be injected with it.
132+
* <p>For most processing scenarios, simply use {@link MockMvc#perform},
133+
* or if you need to configure the {@code DispatcherServlet}, provide a
136134
* {@link DispatcherServletCustomizer} to the {@code MockMvcBuilder}.
137135
* @since 5.1
138136
*/

spring-test/src/main/java/org/springframework/test/web/servlet/ResultMatcher.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
@FunctionalInterface
5050
public interface ResultMatcher {
5151

52-
5352
/**
5453
* Assert the result of an executed request.
5554
* @param result the result of the executed request

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,6 @@ public void setBasicAuth(String username, String password, @Nullable Charset cha
758758
* @see <a href="https://tools.ietf.org/html/rfc6750">RFC 6750</a>
759759
*/
760760
public void setBearerAuth(String token) {
761-
Assert.notNull(token, "Token must not be null");
762-
763761
set(AUTHORIZATION, "Bearer " + token);
764762
}
765763

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public static Log forLogName(Class<?> primaryLoggerClass) {
5959

6060
/**
6161
* Wrap the given primary logger with a composite logger that delegates to
62-
* it or to the fallback logger "org.springframework.web.HttpLogging", if
63-
* the primary is not enabled.
62+
* it or to the fallback logger "org.springframework.web.HttpLogging",
63+
* if the primary is not enabled.
6464
* @param primaryLogger the primary logger to use
6565
* @return the resulting composite logger
6666
*/

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public String getSameSite() {
122122
return this.sameSite;
123123
}
124124

125+
125126
@Override
126127
public boolean equals(Object other) {
127128
if (this == other) {

0 commit comments

Comments
 (0)