diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchHealthIndicator.java index 9a1abf4509..84477e07b3 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchHealthIndicator.java @@ -53,7 +53,7 @@ public class ElasticsearchHealthIndicator extends AbstractHealthIndicator { */ public ElasticsearchHealthIndicator(Client client, long responseTimeout, List indices) { - this(client, responseTimeout, (indices == null ? (String[]) null + this(client, responseTimeout, (indices == null ? null : indices.toArray(new String[indices.size()]))); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java index 00ffffd01e..8f1f2f7dcf 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java @@ -299,8 +299,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping @SuppressWarnings("unchecked") private Map getTemplateVariables(ServerWebExchange exchange) { - return (Map) exchange - .getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); + return exchange.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); } private Mono> handleResult(Publisher result, diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java index e9919e4f53..e2d472815c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. @@ -359,7 +359,7 @@ public final class ConditionMessage { */ public ConditionMessage items(Style style, Object... items) { return items(style, - items == null ? (Collection) null : Arrays.asList(items)); + items == null ? null : Arrays.asList(items)); } /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java index 1cdaff70ef..ba151099ee 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java @@ -265,8 +265,7 @@ public class FlywayAutoConfiguration { private DatabaseDriver getDatabaseDriver() { try { - String url = (String) JdbcUtils.extractDatabaseMetaData(this.dataSource, - "getURL"); + String url = JdbcUtils.extractDatabaseMetaData(this.dataSource, "getURL"); return DatabaseDriver.fromJdbcUrl(url); } catch (MetaDataAccessException ex) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookup.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookup.java index e31b7946d3..1347779224 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookup.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookup.java @@ -69,7 +69,7 @@ final class DatabaseLookup { return Database.DEFAULT; } try { - String url = (String) JdbcUtils.extractDatabaseMetaData(dataSource, "getURL"); + String url = JdbcUtils.extractDatabaseMetaData(dataSource, "getURL"); DatabaseDriver driver = DatabaseDriver.fromJdbcUrl(url); Database database = LOOKUP.get(driver); if (database != null) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiColors.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiColors.java index d831e9dab1..6f6d7080c5 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiColors.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiColors.java @@ -94,7 +94,7 @@ public final class AnsiColors { private final double b; LabColor(Integer rgb) { - this(rgb == null ? (Color) null : new Color(rgb)); + this(rgb == null ? null : new Color(rgb)); } LabColor(Color color) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBean.java index 21b192c99e..665321f3b6 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. @@ -22,7 +22,6 @@ import java.sql.SQLFeatureNotSupportedException; import java.util.Properties; import java.util.logging.Logger; -import javax.sql.DataSource; import javax.sql.XAConnection; import javax.sql.XADataSource; @@ -111,7 +110,7 @@ public class PoolingDataSourceBean extends PoolingDataSource @Override public Logger getParentLogger() throws SQLFeatureNotSupportedException { try { - return ((DataSource) this).getParentLogger(); + return this.getParentLogger(); } catch (Exception ex) { // Work around https://jira.codehaus.org/browse/BTM-134