< prev index next >

src/com/sun/javatest/exec/NewReportDialog.java

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

@@ -139,13 +139,13 @@
          interviewParams = p;
     }
 
     // ---------------------------------------------------------------------------
 
-    void setLastState(Map h) {
-        String rd = (String) (h.get(REPORT_DIR));
-        String filter = (String) (h.get(FILTER));
+    void setLastState(Map<String, String> h) {
+        String rd = (h.get(REPORT_DIR));
+        String filter = (h.get(FILTER));
 
         if (dirField == null)
             initGUI();
 
         dirField.setText(rd);

@@ -899,13 +899,13 @@
 
     private ArrayList<CustomReport> getActiveCustomReports() {
 
         ArrayList<CustomReport> customReps = new ArrayList<>();
         if (customBoxes != null && customBoxes.size() > 0) {
-            Iterator it = customBoxes.keySet().iterator();
+            Iterator<JCheckBox> it = customBoxes.keySet().iterator();
             while (it.hasNext()) {
-                JCheckBox box = (JCheckBox)(it.next());
+                JCheckBox box = (it.next());
                 if (box.isSelected()) {
                     customReps.add(customBoxes.get(box));
                 }
             }
         }

@@ -1094,13 +1094,13 @@
                     tabs.setSelectedIndex(tabs.getTabCount()-1);
                     return;
                 }
 
                 // validate custom reports
-                Iterator it = getActiveCustomReports().iterator();
+                Iterator<CustomReport> it = getActiveCustomReports().iterator();
                 while (it.hasNext()) {
-                    CustomReport cr = (CustomReport) it.next();
+                    CustomReport cr = it.next();
                     String error = cr.validateOptions();
                     if (error != null) {
                         for (int i = 0; i < listModel.getSize(); i++ ) {
                             JCheckBox cb = listModel.elementAt(i);
                             if (cb.getName().equals(cr.getReportId())) {

@@ -1365,11 +1365,11 @@
         /**
          * @param lst JList of checkboxes
          * @param p parent Panel
          * @param cardLayout The CardLayout for options
          */
-        SelectListener(JList lst, JPanel p, CardLayout cardLayout ) {
+        SelectListener(JList<?> lst, JPanel p, CardLayout cardLayout ) {
             list = lst;
             listModel = list.getModel();
             lastSelected = listModel.getElementAt(0);
             panel = p;
             cards = cardLayout;

@@ -1475,12 +1475,12 @@
         private void setOkBtn(JButton okBtn) {
             this.okBtn = okBtn;
         }
 
         Object lastSelected;
-        JList list;
-        ListModel listModel;
+        JList<?> list;
+        ListModel<?> listModel;
         JPanel panel;
         CardLayout cards;
         JButton okBtn = null; // should be disable iff all check boxes are off
         double emptyCBW = new JCheckBox("").getPreferredSize().getWidth() + 2;
     }
< prev index next >