< prev index next >

src/com/sun/javatest/tool/DeskView.java

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

@@ -662,16 +662,16 @@
      * in a map object.
      * @param c the component whose size and position are to be restored.
      * @param m the map in which the information is to be recorded
      * @see #saveBounds
      */
-    protected static void restoreBounds(Component c, Map m) {
+    protected static void restoreBounds(Component c, Map<String, String> m) {
         try {
-            String xs = (String) (m.get("x"));
-            String ys = (String) (m.get("y"));
-            String ws = (String) (m.get("w"));
-            String hs = (String) (m.get("h"));
+            String xs = (m.get("x"));
+            String ys = (m.get("y"));
+            String ws = (m.get("w"));
+            String hs = (m.get("h"));
             if (xs != null && ys != null && ws != null && hs != null) {
                 Rectangle restored = new Rectangle(Integer.parseInt(xs),
                         Integer.parseInt(ys),
                         Integer.parseInt(ws),
                         Integer.parseInt(hs));

@@ -789,18 +789,18 @@
                     m.addSeparator();
                 }
 
             }   // for
 
-            List fileHistory = desktop.getFileHistory();
+            List<Desktop.FileHistoryEntry> fileHistory = desktop.getFileHistory();
 //          if (!fileHistory.isEmpty()) {
         JMenu hm = uif.createMenu("dt.file.recentwd");
         if (!fileHistory.isEmpty()) {
                 int n = 0;
 
-                for (Iterator i = fileHistory.iterator(); i.hasNext(); ) {
-                    Desktop.FileHistoryEntry h = (Desktop.FileHistoryEntry) (i.next());
+                for (Iterator<Desktop.FileHistoryEntry> i = fileHistory.iterator(); i.hasNext(); ) {
+                    Desktop.FileHistoryEntry h = (i.next());
                     if (!h.file.exists())
                         continue;
                     String s = uif.getI18NString("dt.file.historyX.mit",
                                              new Object[] {new Integer(n), h.file.getPath()});
                     JMenuItem mi = new JMenuItem(s);
< prev index next >