Refactor some lines to use better Generics syntax
Refs: #8039
Showing
1 changed file
with
7 additions
and
7 deletions
... | @@ -453,10 +453,10 @@ public class DirectControlServlet extends HttpServlet { | ... | @@ -453,10 +453,10 @@ public class DirectControlServlet extends HttpServlet { |
453 | context.put("httpProtocol", request.getProtocol()); | 453 | context.put("httpProtocol", request.getProtocol()); |
454 | context.put("httpScheme", request.getScheme()); | 454 | context.put("httpScheme", request.getScheme()); |
455 | 455 | ||
456 | Enumeration headerNames = request.getHeaderNames(); | 456 | Enumeration<String> headerNames = request.getHeaderNames(); |
457 | Map<String, List> headerMap = new HashMap<String, List>(); | 457 | Map<String, List<String>> headerMap = new HashMap<String, List<String>>(); |
458 | while(headerNames.hasMoreElements()) { | 458 | while (headerNames.hasMoreElements()) { |
459 | String headerName = (String) headerNames.nextElement(); | 459 | String headerName = headerNames.nextElement(); |
460 | headerMap.put(headerName, Collections.list(request.getHeaders(headerName))); | 460 | headerMap.put(headerName, Collections.list(request.getHeaders(headerName))); |
461 | } | 461 | } |
462 | context.put("httpHeaders", headerMap); | 462 | context.put("httpHeaders", headerMap); |
... | @@ -467,9 +467,9 @@ public class DirectControlServlet extends HttpServlet { | ... | @@ -467,9 +467,9 @@ public class DirectControlServlet extends HttpServlet { |
467 | 467 | ||
468 | if (result.get("httpHeaders") != null) { | 468 | if (result.get("httpHeaders") != null) { |
469 | Map<String, List<String>> headers = (Map<String,List<String>>) result.get("httpHeaders"); | 469 | Map<String, List<String>> headers = (Map<String,List<String>>) result.get("httpHeaders"); |
470 | for (String headerName : (Set<String>) headers.keySet()) { | 470 | for (Map.Entry<String, List<String>> header : headers.entrySet()) { |
471 | for (String value : headers.get(headerName)) { | 471 | for (String value : header.getValue()) { |
472 | response.addHeader(headerName, value); | 472 | response.addHeader(header.getKey(), value); |
473 | } | 473 | } |
474 | } | 474 | } |
475 | } | 475 | } | ... | ... |
-
Please register or sign in to post a comment