80ba65d8 by Ean Schuessler

Refactor some lines to use better Generics syntax

Refs: #8039
1 parent caf32c83
......@@ -453,10 +453,10 @@ public class DirectControlServlet extends HttpServlet {
context.put("httpProtocol", request.getProtocol());
context.put("httpScheme", request.getScheme());
Enumeration headerNames = request.getHeaderNames();
Map<String, List> headerMap = new HashMap<String, List>();
while(headerNames.hasMoreElements()) {
String headerName = (String) headerNames.nextElement();
Enumeration<String> headerNames = request.getHeaderNames();
Map<String, List<String>> headerMap = new HashMap<String, List<String>>();
while (headerNames.hasMoreElements()) {
String headerName = headerNames.nextElement();
headerMap.put(headerName, Collections.list(request.getHeaders(headerName)));
}
context.put("httpHeaders", headerMap);
......@@ -467,9 +467,9 @@ public class DirectControlServlet extends HttpServlet {
if (result.get("httpHeaders") != null) {
Map<String, List<String>> headers = (Map<String,List<String>>) result.get("httpHeaders");
for (String headerName : (Set<String>) headers.keySet()) {
for (String value : headers.get(headerName)) {
response.addHeader(headerName, value);
for (Map.Entry<String, List<String>> header : headers.entrySet()) {
for (String value : header.getValue()) {
response.addHeader(header.getKey(), value);
}
}
}
......