Skip to content

Commit cdc234d

Browse files
committed
Polish contribution
See gh-25446
1 parent c547809 commit cdc234d

File tree

9 files changed

+16
-17
lines changed

9 files changed

+16
-17
lines changed

spring-context-indexer/src/main/java/org/springframework/context/index/processor/CandidateComponentsIndexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 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-context-support/src/main/java/org/springframework/cache/jcache/interceptor/KeyGeneratorAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 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-jms/src/test/java/org/springframework/jms/core/JmsMessagingTemplateTests.java

Lines changed: 1 addition & 1 deletion
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-2020 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-orm/src/main/java/org/springframework/orm/hibernate5/SessionHolder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -49,6 +49,7 @@ public class SessionHolder extends EntityManagerHolder {
4949
private FlushMode previousFlushMode;
5050

5151

52+
@SuppressWarnings("cast")
5253
public SessionHolder(Session session) {
5354
// Check below is always true against Hibernate >= 5.2 but not against 5.0/5.1 at runtime
5455
super(session instanceof EntityManager ? session : null);

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

Lines changed: 5 additions & 7 deletions
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-2020 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.
@@ -67,13 +67,11 @@ public ResultMatcher handlerType(Class<?> type) {
6767
return result -> {
6868
Object handler = result.getHandler();
6969
assertNotNull("No handler", handler);
70-
if (handler != null) {
71-
Class<?> actual = handler.getClass();
72-
if (handler instanceof HandlerMethod) {
73-
actual = ((HandlerMethod) handler).getBeanType();
74-
}
75-
assertEquals("Handler type", type, ClassUtils.getUserClass(actual));
70+
Class<?> actual = handler.getClass();
71+
if (handler instanceof HandlerMethod) {
72+
actual = ((HandlerMethod) handler).getBeanType();
7673
}
74+
assertEquals("Handler type", type, ClassUtils.getUserClass(actual));
7775
};
7876
}
7977

spring-tx/src/main/java/org/springframework/dao/support/DataAccessUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 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-web/src/main/java/org/springframework/http/client/SimpleClientHttpRequestFactory.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-2020 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-web/src/main/java/org/springframework/http/server/ServletServerHttpRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 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-web/src/test/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactoryTests.java

Lines changed: 3 additions & 3 deletions
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-2020 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.
@@ -66,7 +66,7 @@ public void assertCustomConfig() throws Exception {
6666

6767
Object config = request.getHttpContext().getAttribute(HttpClientContext.REQUEST_CONFIG);
6868
assertThat(config).as("Request config should be set").isNotNull();
69-
assertThat(config instanceof RequestConfig).as("Wrong request config type" + config.getClass().getName()).isTrue();
69+
assertThat(config).as("Wrong request config type" + config.getClass().getName()).isInstanceOf(RequestConfig.class);
7070
RequestConfig requestConfig = (RequestConfig) config;
7171
assertThat(requestConfig.getConnectTimeout()).as("Wrong custom connection timeout").isEqualTo(1234);
7272
assertThat(requestConfig.getConnectionRequestTimeout()).as("Wrong custom connection request timeout").isEqualTo(4321);
@@ -132,7 +132,7 @@ public HttpClient getHttpClient() {
132132
assertThat(requestConfig.getConnectionRequestTimeout()).isEqualTo(-1);
133133
assertThat(requestConfig.getSocketTimeout()).isEqualTo(5000);
134134

135-
// Update the Http client so that it returns an updated config
135+
// Update the Http client so that it returns an updated config
136136
RequestConfig updatedDefaultConfig = RequestConfig.custom()
137137
.setConnectTimeout(1234).build();
138138
given(configurable.getConfig()).willReturn(updatedDefaultConfig);

0 commit comments

Comments
 (0)