< prev index next >

src/com/sun/jct/utils/mapmerge/Main.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg

@@ -134,12 +134,12 @@
         public void addFileSet(FileSet fs) {
             fileSets.add(fs);
         }
 
         public void execute() {
-            for (Iterator iter = fileSets.iterator(); iter.hasNext(); ) {
-                FileSet fs = (FileSet) iter.next();
+            for (Iterator<FileSet> iter = fileSets.iterator(); iter.hasNext(); ) {
+                FileSet fs = iter.next();
                 FileScanner s = fs.getDirectoryScanner(getProject());
                 m.addFiles(s.getBasedir(), s.getIncludedFiles());
             }
             try {
                 m.run();

@@ -182,21 +182,21 @@
         out.println("  PUBLIC \"-//Sun Microsystems Inc.//DTD JavaHelp Map Version 1.0//EN\"");
         out.println("         \"http://java.sun.com/products/javahelp/map_1_0.dtd\">");
         out.println("<map version=\"1.0\">");
 
         int maxLen = 0;
-        for (Iterator iter = map.entrySet().iterator(); iter.hasNext(); ) {
-            Map.Entry e = (Map.Entry) (iter.next());
-            String target = (String) (e.getKey());
-            String url = (String) (e.getValue());
+        for (Iterator<Map.Entry<String, String>> iter = map.entrySet().iterator(); iter.hasNext(); ) {
+            Map.Entry<String, String> e = iter.next();
+            String target = e.getKey();
+            String url = e.getValue();
             maxLen = Math.max(maxLen, target.length());
         }
 
-        for (Iterator iter = map.entrySet().iterator(); iter.hasNext(); ) {
-            Map.Entry e = (Map.Entry) (iter.next());
-            String target = (String) (e.getKey());
-            String url = (String) (e.getValue());
+        for (Iterator<Map.Entry<String, String>> iter = map.entrySet().iterator(); iter.hasNext(); ) {
+            Map.Entry<String, String> e = iter.next();
+            String target = e.getKey();
+            String url = e.getValue();
             out.print("  <mapID target=\"" + target + "\"  ");
             for (int i = target.length(); i < maxLen; i++)
                 out.print(' ');
             out.println(" url=\"" + url + "\" />");
         }
< prev index next >