Skip to content

Commit 36e4951

Browse files
committed
Polishing
1 parent 87b5080 commit 36e4951

File tree

5 files changed

+17
-21
lines changed

5 files changed

+17
-21
lines changed

spring-context/src/test/resources/org/springframework/jmx/export/notificationPublisherTests.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55

66
<bean id="publisher" class="org.springframework.jmx.export.NotificationPublisherTests$MyNotificationPublisher"/>
77

8-
<bean id="publisherMBean" class="org.springframework.jmx.export.NotificationPublisherTests$MyNotificationPublisherMBean"/>
8+
<bean id="publisherMBean" class="org.springframework.jmx.export.NotificationPublisherTests$MyNotificationPublisherMBean"/>
99

10-
<bean id="publisherStandardMBean" class="org.springframework.jmx.export.NotificationPublisherTests$MyNotificationPublisherStandardMBean"/>
10+
<bean id="publisherStandardMBean" class="org.springframework.jmx.export.NotificationPublisherTests$MyNotificationPublisherStandardMBean"/>
1111

1212
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
1313
<property name="beans">
1414
<map>
1515
<entry key="spring:type=Publisher" value-ref="publisher"/>
16-
<entry key="spring:type=PublisherMBean" value-ref="publisherMBean"/>
17-
<entry key="spring:type=PublisherStandardMBean" value-ref="publisherStandardMBean"/>
16+
<entry key="spring:type=PublisherMBean" value-ref="publisherMBean"/>
17+
<entry key="spring:type=PublisherStandardMBean" value-ref="publisherStandardMBean"/>
1818
</map>
1919
</property>
20-
<property name="server" ref="server"/>
20+
<property name="server" ref="server"/>
2121
</bean>
2222

2323
</beans>

spring-core/src/main/java/org/springframework/core/convert/Property.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 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.
@@ -47,7 +47,7 @@
4747
*/
4848
public final class Property {
4949

50-
private static Map<Property, Annotation[]> annotationCache = new ConcurrentReferenceHashMap<>();
50+
private static final Map<Property, Annotation[]> annotationCache = new ConcurrentReferenceHashMap<>();
5151

5252
private final Class<?> objectType;
5353

@@ -118,7 +118,7 @@ public Method getWriteMethod() {
118118
}
119119

120120

121-
// package private
121+
// Package private
122122

123123
MethodParameter getMethodParameter() {
124124
return this.methodParameter;
@@ -132,7 +132,7 @@ Annotation[] getAnnotations() {
132132
}
133133

134134

135-
// internal helpers
135+
// Internal helpers
136136

137137
private String resolveName() {
138138
if (this.readMethod != null) {

spring-expression/src/main/java/org/springframework/expression/spel/ast/ConstructorReference.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ private TypedValue createArray(ExpressionState state) throws EvaluationException
288288
else {
289289
// There is an initializer
290290
if (this.dimensions == null || this.dimensions.length > 1) {
291-
// There is an initializer but this is a multi-dimensional array (e.g. new int[][]{{1,2},{3,4}}) - this
292-
// is not currently supported
291+
// There is an initializer but this is a multi-dimensional array (e.g. new int[][]{{1,2},{3,4}})
292+
// - this is not currently supported
293293
throw new SpelEvaluationException(getStartPosition(),
294294
SpelMessage.MULTIDIM_ARRAY_INITIALIZER_NOT_SUPPORTED);
295295
}

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 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.
@@ -190,7 +190,7 @@ public InetSocketAddress getRemoteAddress() {
190190
@Nullable
191191
protected SslInfo initSslInfo() {
192192
X509Certificate[] certificates = getX509Certificates();
193-
return certificates != null ? new DefaultSslInfo(getSslSessionId(), certificates) : null;
193+
return (certificates != null ? new DefaultSslInfo(getSslSessionId(), certificates) : null);
194194
}
195195

196196
@Nullable
@@ -200,8 +200,7 @@ private String getSslSessionId() {
200200

201201
@Nullable
202202
private X509Certificate[] getX509Certificates() {
203-
String name = "javax.servlet.request.X509Certificate";
204-
return (X509Certificate[]) this.request.getAttribute(name);
203+
return (X509Certificate[]) this.request.getAttribute("javax.servlet.request.X509Certificate");
205204
}
206205

207206
@Override

spring-web/src/test/java/org/springframework/http/codec/json/Jackson2JsonEncoderTests.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 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.
@@ -81,8 +81,6 @@ public void canEncode() {
8181

8282
// SPR-15910
8383
assertThat(this.encoder.canEncode(ResolvableType.forClass(Object.class), APPLICATION_OCTET_STREAM)).isFalse();
84-
85-
8684
}
8785

8886
@Override
@@ -100,7 +98,7 @@ public void encode() throws Exception {
10098
APPLICATION_STREAM_JSON, null);
10199
}
102100

103-
@Test // SPR-15866
101+
@Test // SPR-15866
104102
public void canEncodeWithCustomMimeType() {
105103
MimeType textJavascript = new MimeType("text", "javascript", StandardCharsets.UTF_8);
106104
Jackson2JsonEncoder encoder = new Jackson2JsonEncoder(new ObjectMapper(), textJavascript);
@@ -212,7 +210,7 @@ public void classLevelJsonView() {
212210
null, hints);
213211
}
214212

215-
@Test // gh-22771
213+
@Test // gh-22771
216214
public void encodeWithFlushAfterWriteOff() {
217215
ObjectMapper mapper = new ObjectMapper();
218216
mapper.configure(SerializationFeature.FLUSH_AFTER_WRITE_VALUE, false);
@@ -235,7 +233,6 @@ public void encodeAscii() {
235233
.consumeNextWith(expectString("{\"foo\":\"foo\",\"bar\":\"bar\"}"))
236234
.verifyComplete(),
237235
new MimeType("application", "json", StandardCharsets.US_ASCII), null);
238-
239236
}
240237

241238

0 commit comments

Comments
 (0)