Use pattern matching for instanceof where appropriate
See gh-31475
This commit is contained in:
committed by
Andy Wilkinson
parent
a7b98e7312
commit
5db04da275
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -90,8 +90,8 @@ public class MockClientHttpRequestFactory implements ClientHttpRequestFactory {
|
||||
protected ClientHttpResponse executeInternal() throws IOException {
|
||||
MockClientHttpRequestFactory.this.executedRequests.add(this);
|
||||
Object response = MockClientHttpRequestFactory.this.responses.pollFirst();
|
||||
if (response instanceof IOException) {
|
||||
throw (IOException) response;
|
||||
if (response instanceof IOException ioException) {
|
||||
throw ioException;
|
||||
}
|
||||
if (response == null) {
|
||||
response = new Response(0, null, HttpStatus.GONE);
|
||||
|
||||
Reference in New Issue
Block a user