Skip to content

Commit 114ece5

Browse files
committed
Merge pull request #12011 from igor-suhorukov:master
* pr/12011: Polish "Remove redundant casts" Remove redundant casts
2 parents 74cede5 + 31da4cc commit 114ece5

File tree

7 files changed

+9
-12
lines changed

7 files changed

+9
-12
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchHealthIndicator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class ElasticsearchHealthIndicator extends AbstractHealthIndicator {
5353
*/
5454
public ElasticsearchHealthIndicator(Client client, long responseTimeout,
5555
List<String> indices) {
56-
this(client, responseTimeout, (indices == null ? (String[]) null
56+
this(client, responseTimeout, (indices == null ? null
5757
: indices.toArray(new String[indices.size()])));
5858
}
5959

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ private Map<String, Object> getArguments(ServerWebExchange exchange,
299299

300300
@SuppressWarnings("unchecked")
301301
private Map<String, String> getTemplateVariables(ServerWebExchange exchange) {
302-
return (Map<String, String>) exchange
303-
.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
302+
return exchange.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
304303
}
305304

306305
private Mono<ResponseEntity<Object>> handleResult(Publisher<?> result,

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-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.
@@ -359,7 +359,7 @@ public ConditionMessage items(Object... items) {
359359
*/
360360
public ConditionMessage items(Style style, Object... items) {
361361
return items(style,
362-
items == null ? (Collection<?>) null : Arrays.asList(items));
362+
items == null ? null : Arrays.asList(items));
363363
}
364364

365365
/**

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,7 @@ private String[] replaceVendorLocations(String[] locations,
265265

266266
private DatabaseDriver getDatabaseDriver() {
267267
try {
268-
String url = (String) JdbcUtils.extractDatabaseMetaData(this.dataSource,
269-
"getURL");
268+
String url = JdbcUtils.extractDatabaseMetaData(this.dataSource, "getURL");
270269
return DatabaseDriver.fromJdbcUrl(url);
271270
}
272271
catch (MetaDataAccessException ex) {

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static Database getDatabase(DataSource dataSource) {
6969
return Database.DEFAULT;
7070
}
7171
try {
72-
String url = (String) JdbcUtils.extractDatabaseMetaData(dataSource, "getURL");
72+
String url = JdbcUtils.extractDatabaseMetaData(dataSource, "getURL");
7373
DatabaseDriver driver = DatabaseDriver.fromJdbcUrl(url);
7474
Database database = LOOKUP.get(driver);
7575
if (database != null) {

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiColors.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private static final class LabColor {
9494
private final double b;
9595

9696
LabColor(Integer rgb) {
97-
this(rgb == null ? (Color) null : new Color(rgb));
97+
this(rgb == null ? null : new Color(rgb));
9898
}
9999

100100
LabColor(Color color) {

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBean.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-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.
@@ -22,7 +22,6 @@
2222
import java.util.Properties;
2323
import java.util.logging.Logger;
2424

25-
import javax.sql.DataSource;
2625
import javax.sql.XAConnection;
2726
import javax.sql.XADataSource;
2827

@@ -111,7 +110,7 @@ public XAStatefulHolder createPooledConnection(Object xaFactory, ResourceBean be
111110
@Override
112111
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
113112
try {
114-
return ((DataSource) this).getParentLogger();
113+
return this.getParentLogger();
115114
}
116115
catch (Exception ex) {
117116
// Work around https://jira.codehaus.org/browse/BTM-134

0 commit comments

Comments
 (0)