Replace use of Iterator with Java 5 foreach loops

Issues: SWF-1532
This commit is contained in:
Phillip Webb
2012-04-05 15:52:09 -07:00
parent 22b018e95a
commit 34f4837ebd
35 changed files with 113 additions and 255 deletions

View File

@@ -196,9 +196,7 @@ public class AjaxTilesView extends TilesView {
if (attributeContext.getCascadedAttributeNames() != null) {
attributeNames.addAll(attributeContext.getCascadedAttributeNames());
}
Iterator<String> iterator = attributeNames.iterator();
while (iterator.hasNext()) {
String name = iterator.next();
for (String name : attributeNames) {
Attribute attr = attributeContext.getAttribute(name);
resultMap.put(name, attr);
}

View File

@@ -25,7 +25,6 @@ import java.net.URLConnection;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.zip.GZIPOutputStream;
@@ -166,9 +165,7 @@ public class ResourceServlet extends HttpServletBean {
private boolean matchesCompressedMimeTypes(String mimeType) {
PathMatcher pathMatcher = new AntPathMatcher();
Iterator<String> compressedMimeTypesIt = compressedMimeTypes.iterator();
while (compressedMimeTypesIt.hasNext()) {
String compressedMimeType = compressedMimeTypesIt.next();
for (String compressedMimeType : compressedMimeTypes) {
if (pathMatcher.match(compressedMimeType, mimeType)) {
return true;
}
@@ -298,9 +295,7 @@ public class ResourceServlet extends HttpServletBean {
return false;
}
PathMatcher pathMatcher = new AntPathMatcher();
Iterator<String> allowedResourcePathsIt = allowedResourcePaths.iterator();
while (allowedResourcePathsIt.hasNext()) {
String pattern = allowedResourcePathsIt.next();
for (String pattern : allowedResourcePaths) {
if (pathMatcher.match(pattern, resourcePath)) {
return true;
}