Skip to content

Commit aee1243

Browse files
hduelmegregturn
authored andcommitted
Use Collections.emptyIterator instead of grabbing the iterator from an empty list.
Resolves #1327.
1 parent f2bfc4a commit aee1243

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public Iterator<String> getResponseHeaderNames() throws IOException {
9898
@Override
9999
public Iterator<String> getResponseHeaders(String name) throws IOException {
100100
List<String> headers = response.getHeaders().get(name);
101-
return headers != null ? headers.iterator() : Collections.<String> emptyList().iterator();
101+
return headers != null ? headers.iterator() : Collections.emptyIterator();
102102
}
103103

104104
@Override

spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public Iterator<String> getResponseHeaders(String name) throws IOException {
132132
List<String> headerValues = headersListMappedByLowerCaseName.get(name.toLowerCase());
133133

134134
if (headerValues == null) {
135-
return Collections.<String> emptyList().iterator();
135+
return Collections.emptyIterator();
136136
} else {
137137
return headerValues.iterator();
138138
}

spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpExchangeConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public Iterator<String> getRequestHeaderNames() throws IOException {
109109
@Override
110110
public Iterator<String> getRequestHeaders(String name) throws IOException {
111111
List<String> headers = httpExchange.getRequestHeaders().get(name);
112-
return headers != null ? headers.iterator() : Collections.<String> emptyList().iterator();
112+
return headers != null ? headers.iterator() : Collections.emptyIterator();
113113
}
114114

115115
@Override

spring-ws-support/src/main/java/org/springframework/ws/transport/jms/support/JmsTransportUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public static Iterator<String> getHeaders(Message message, String name) throws J
154154
if (value != null) {
155155
return Collections.singletonList(value).iterator();
156156
} else {
157-
return Collections.<String> emptyList().iterator();
157+
return Collections.emptyIterator();
158158
}
159159
}
160160

spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/support/XmppTransportUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static Iterator<String> getHeaders(Message message, String name) {
7474
if (value != null) {
7575
return Collections.singletonList(value).iterator();
7676
} else {
77-
return Collections.<String> emptyList().iterator();
77+
return Collections.emptyIterator();
7878
}
7979
}
8080

0 commit comments

Comments
 (0)