Skip to content

Commit 5532574

Browse files
committed
Remove unused casts and variables
1 parent 1b3e96b commit 5532574

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

spring-core/src/test/java/org/springframework/core/codec/ResourceEncoderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected void testEncodeError(Publisher<?> input, ResolvableType outputType,
8080

8181
Flux<Resource> i = Flux.error(new InputException());
8282

83-
Flux<DataBuffer> result = ((Encoder<Resource>) this.encoder).encode(i,
83+
Flux<DataBuffer> result = this.encoder.encode(i,
8484
this.bufferFactory, outputType,
8585
mimeType, hints);
8686

spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationCoverageTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,7 @@ void functionReferenceNonCompilableArguments_SPR12359() throws Exception {
25222522
expression = parser.parseExpression("#negate(#ints.?[#this<2][0])");
25232523
assertThat(expression.getValue(context, Integer.class).toString()).isEqualTo("-1");
25242524
// Selection isn't compilable.
2525-
assertThat(((SpelNodeImpl)((SpelExpression) expression).getAST()).isCompilable()).isFalse();
2525+
assertThat(((SpelExpression) expression).getAST().isCompilable()).isFalse();
25262526
}
25272527

25282528
@Test

spring-expression/src/test/java/org/springframework/expression/spel/ast/InlineCollectionTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -88,14 +88,14 @@ void listWithPropertyAccessIsNotCached() {
8888
@Test
8989
void listCanBeCompiled() {
9090
SpelExpression listExpression = parseExpression("{1, -2, 3, 4}");
91-
assertThat(((SpelNodeImpl) listExpression.getAST()).isCompilable()).isTrue();
91+
assertThat(listExpression.getAST().isCompilable()).isTrue();
9292
assertThat(SpelCompiler.compile(listExpression)).isTrue();
9393
}
9494

9595
@Test
9696
void dynamicListCannotBeCompiled() {
9797
SpelExpression listExpression = parseExpression("{1, (5 - 3), 3, 4}");
98-
assertThat(((SpelNodeImpl) listExpression.getAST()).isCompilable()).isFalse();
98+
assertThat(listExpression.getAST().isCompilable()).isFalse();
9999
assertThat(SpelCompiler.compile(listExpression)).isFalse();
100100
}
101101

spring-web/src/main/java/org/springframework/http/client/JdkClientHttpRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ protected ClientHttpResponse executeInternal(HttpHeaders headers, @Nullable Body
120120
catch (ExecutionException ex) {
121121
Throwable cause = ex.getCause();
122122

123-
if (cause instanceof CancellationException caEx) {
123+
if (cause instanceof CancellationException) {
124124
throw new HttpTimeoutException("Request timed out");
125125
}
126126
if (cause instanceof UncheckedIOException uioEx) {

spring-web/src/test/java/org/springframework/web/ErrorResponseExceptionTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ private void assertDetailMessageCode(
459459
ErrorResponse ex, @Nullable String suffix, @Nullable Object[] arguments) {
460460

461461
assertThat(ex.getDetailMessageCode())
462-
.isEqualTo(ErrorResponse.getDefaultDetailMessageCode(((Exception) ex).getClass(), suffix));
462+
.isEqualTo(ErrorResponse.getDefaultDetailMessageCode(ex.getClass(), suffix));
463463

464464
if (arguments != null) {
465465
assertThat(ex.getDetailMessageArguments()).containsExactlyElementsOf(Arrays.asList(arguments));

0 commit comments

Comments
 (0)