Remove redundant casts

See gh-12011
pull/12011/merge
igor-suhorukov 7 years ago committed by Stephane Nicoll
parent 74cede5cdc
commit 71351de694

@ -53,7 +53,7 @@ public class ElasticsearchHealthIndicator extends AbstractHealthIndicator {
*/
public ElasticsearchHealthIndicator(Client client, long responseTimeout,
List<String> indices) {
this(client, responseTimeout, (indices == null ? (String[]) null
this(client, responseTimeout, (indices == null ? null
: indices.toArray(new String[indices.size()])));
}

@ -299,8 +299,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping
@SuppressWarnings("unchecked")
private Map<String, String> getTemplateVariables(ServerWebExchange exchange) {
return (Map<String, String>) exchange
.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
return exchange.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
}
private Mono<ResponseEntity<Object>> handleResult(Publisher<?> result,

@ -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));
}
/**

@ -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) {

@ -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) {

@ -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) {

@ -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

Loading…
Cancel
Save