1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Fix concurrent exception that appears from time to time

This commit is contained in:
davigonz 2019-08-06 16:44:13 +02:00
parent 91c6183090
commit 176de93abc

View File

@ -30,7 +30,7 @@ import okhttp3.Response;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.ListIterator;
/** /**
* Http interceptor to use multiple interceptors in the same {@link okhttp3.OkHttpClient} instance * Http interceptor to use multiple interceptors in the same {@link okhttp3.OkHttpClient} instance
@ -86,7 +86,7 @@ public class HttpInterceptor implements Interceptor {
} }
public void deleteRequestHeaderInterceptor(String headerName) { public void deleteRequestHeaderInterceptor(String headerName) {
Iterator<RequestInterceptor> requestInterceptorIterator = mRequestInterceptors.iterator(); ListIterator<RequestInterceptor> requestInterceptorIterator = mRequestInterceptors.listIterator();
while (requestInterceptorIterator.hasNext()) { while (requestInterceptorIterator.hasNext()) {
RequestInterceptor currentRequestInterceptor = requestInterceptorIterator.next(); RequestInterceptor currentRequestInterceptor = requestInterceptorIterator.next();
if (currentRequestInterceptor instanceof RequestHeaderInterceptor && if (currentRequestInterceptor instanceof RequestHeaderInterceptor &&