Remove unused casts and variables
This commit is contained in:
parent
1b3e96b9bf
commit
5532574f56
|
|
@ -80,7 +80,7 @@ class ResourceEncoderTests extends AbstractEncoderTests<ResourceEncoder> {
|
||||||
|
|
||||||
Flux<Resource> i = Flux.error(new InputException());
|
Flux<Resource> i = Flux.error(new InputException());
|
||||||
|
|
||||||
Flux<DataBuffer> result = ((Encoder<Resource>) this.encoder).encode(i,
|
Flux<DataBuffer> result = this.encoder.encode(i,
|
||||||
this.bufferFactory, outputType,
|
this.bufferFactory, outputType,
|
||||||
mimeType, hints);
|
mimeType, hints);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2522,7 +2522,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||||
expression = parser.parseExpression("#negate(#ints.?[#this<2][0])");
|
expression = parser.parseExpression("#negate(#ints.?[#this<2][0])");
|
||||||
assertThat(expression.getValue(context, Integer.class).toString()).isEqualTo("-1");
|
assertThat(expression.getValue(context, Integer.class).toString()).isEqualTo("-1");
|
||||||
// Selection isn't compilable.
|
// Selection isn't compilable.
|
||||||
assertThat(((SpelNodeImpl)((SpelExpression) expression).getAST()).isCompilable()).isFalse();
|
assertThat(((SpelExpression) expression).getAST().isCompilable()).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2023 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -88,14 +88,14 @@ class InlineCollectionTests {
|
||||||
@Test
|
@Test
|
||||||
void listCanBeCompiled() {
|
void listCanBeCompiled() {
|
||||||
SpelExpression listExpression = parseExpression("{1, -2, 3, 4}");
|
SpelExpression listExpression = parseExpression("{1, -2, 3, 4}");
|
||||||
assertThat(((SpelNodeImpl) listExpression.getAST()).isCompilable()).isTrue();
|
assertThat(listExpression.getAST().isCompilable()).isTrue();
|
||||||
assertThat(SpelCompiler.compile(listExpression)).isTrue();
|
assertThat(SpelCompiler.compile(listExpression)).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void dynamicListCannotBeCompiled() {
|
void dynamicListCannotBeCompiled() {
|
||||||
SpelExpression listExpression = parseExpression("{1, (5 - 3), 3, 4}");
|
SpelExpression listExpression = parseExpression("{1, (5 - 3), 3, 4}");
|
||||||
assertThat(((SpelNodeImpl) listExpression.getAST()).isCompilable()).isFalse();
|
assertThat(listExpression.getAST().isCompilable()).isFalse();
|
||||||
assertThat(SpelCompiler.compile(listExpression)).isFalse();
|
assertThat(SpelCompiler.compile(listExpression)).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ class JdkClientHttpRequest extends AbstractStreamingClientHttpRequest {
|
||||||
catch (ExecutionException ex) {
|
catch (ExecutionException ex) {
|
||||||
Throwable cause = ex.getCause();
|
Throwable cause = ex.getCause();
|
||||||
|
|
||||||
if (cause instanceof CancellationException caEx) {
|
if (cause instanceof CancellationException) {
|
||||||
throw new HttpTimeoutException("Request timed out");
|
throw new HttpTimeoutException("Request timed out");
|
||||||
}
|
}
|
||||||
if (cause instanceof UncheckedIOException uioEx) {
|
if (cause instanceof UncheckedIOException uioEx) {
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,7 @@ class ErrorResponseExceptionTests {
|
||||||
ErrorResponse ex, @Nullable String suffix, @Nullable Object[] arguments) {
|
ErrorResponse ex, @Nullable String suffix, @Nullable Object[] arguments) {
|
||||||
|
|
||||||
assertThat(ex.getDetailMessageCode())
|
assertThat(ex.getDetailMessageCode())
|
||||||
.isEqualTo(ErrorResponse.getDefaultDetailMessageCode(((Exception) ex).getClass(), suffix));
|
.isEqualTo(ErrorResponse.getDefaultDetailMessageCode(ex.getClass(), suffix));
|
||||||
|
|
||||||
if (arguments != null) {
|
if (arguments != null) {
|
||||||
assertThat(ex.getDetailMessageArguments()).containsExactlyElementsOf(Arrays.asList(arguments));
|
assertThat(ex.getDetailMessageArguments()).containsExactlyElementsOf(Arrays.asList(arguments));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue