Use Collections.emptyIterator instead of grabbing the iterator from an empty list.
Resolves #1327.
This commit is contained in:
committed by
Greg L. Turnquist
parent
f2bfc4acce
commit
aee1243d6c
@@ -98,7 +98,7 @@ public class ClientHttpRequestConnection extends AbstractHttpSenderConnection {
|
||||
@Override
|
||||
public Iterator<String> getResponseHeaders(String name) throws IOException {
|
||||
List<String> headers = response.getHeaders().get(name);
|
||||
return headers != null ? headers.iterator() : Collections.<String> emptyList().iterator();
|
||||
return headers != null ? headers.iterator() : Collections.emptyIterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -132,7 +132,7 @@ public class HttpUrlConnection extends AbstractHttpSenderConnection {
|
||||
List<String> headerValues = headersListMappedByLowerCaseName.get(name.toLowerCase());
|
||||
|
||||
if (headerValues == null) {
|
||||
return Collections.<String> emptyList().iterator();
|
||||
return Collections.emptyIterator();
|
||||
} else {
|
||||
return headerValues.iterator();
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public class HttpExchangeConnection extends AbstractReceiverConnection
|
||||
@Override
|
||||
public Iterator<String> getRequestHeaders(String name) throws IOException {
|
||||
List<String> headers = httpExchange.getRequestHeaders().get(name);
|
||||
return headers != null ? headers.iterator() : Collections.<String> emptyList().iterator();
|
||||
return headers != null ? headers.iterator() : Collections.emptyIterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -154,7 +154,7 @@ public abstract class JmsTransportUtils {
|
||||
if (value != null) {
|
||||
return Collections.singletonList(value).iterator();
|
||||
} else {
|
||||
return Collections.<String> emptyList().iterator();
|
||||
return Collections.emptyIterator();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public abstract class XmppTransportUtils {
|
||||
if (value != null) {
|
||||
return Collections.singletonList(value).iterator();
|
||||
} else {
|
||||
return Collections.<String> emptyList().iterator();
|
||||
return Collections.emptyIterator();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user