Replace remaining usage of LinkedList with ArrayList/ArrayDeque

Closes gh-25650
This commit is contained in:
Juergen Hoeller
2020-08-26 18:32:08 +02:00
parent d198c4426f
commit 874574513c
65 changed files with 239 additions and 239 deletions

View File

@@ -18,11 +18,11 @@ package org.springframework.test.web.client;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -48,9 +48,9 @@ import org.springframework.util.Assert;
*/
public abstract class AbstractRequestExpectationManager implements RequestExpectationManager {
private final List<RequestExpectation> expectations = new LinkedList<>();
private final List<RequestExpectation> expectations = new ArrayList<>();
private final List<ClientHttpRequest> requests = new LinkedList<>();
private final List<ClientHttpRequest> requests = new ArrayList<>();
private final Map<ClientHttpRequest, Throwable> requestFailures = new LinkedHashMap<>();
@@ -81,7 +81,7 @@ public abstract class AbstractRequestExpectationManager implements RequestExpect
@SuppressWarnings("deprecation")
@Override
public ClientHttpResponse validateRequest(ClientHttpRequest request) throws IOException {
RequestExpectation expectation = null;
RequestExpectation expectation;
synchronized (this.requests) {
if (this.requests.isEmpty()) {
afterExpectationsDeclared();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 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.
@@ -17,7 +17,7 @@
package org.springframework.test.web.client;
import java.io.IOException;
import java.util.LinkedList;
import java.util.ArrayList;
import java.util.List;
import org.springframework.http.client.ClientHttpRequest;
@@ -36,7 +36,7 @@ public class DefaultRequestExpectation implements RequestExpectation {
private final RequestCount requestCount;
private final List<RequestMatcher> requestMatchers = new LinkedList<>();
private final List<RequestMatcher> requestMatchers = new ArrayList<>(1);
@Nullable
private ResponseCreator responseCreator;