< prev index next >

## src/com/sun/javatest/audit/OptionsDialog.java

Print this page

    @@ -190,11 +190,11 @@
         }

         private void updateTestSuiteChoices() {
             // get the paths of currently loaded test suites
             // could move this to TestSuite, and use the dirMap cache
    -        SortedSet s = new TreeSet();
    +        SortedSet<String> s = new TreeSet<>();
             Desktop d = tool.getDesktop();
             Tool[] tools = d.getTools();
             if (tools != null) {
                 for (int i = 0; i < tools.length; i++) {
                     Tool t = tools[i];

    @@ -235,11 +235,11 @@
                 // ignore
             }

             // get the paths of currently loaded work directories
             // could move this to WorkDirectory and use the dirMap cache
    -        SortedSet s = new TreeSet();
    +        SortedSet<String> s = new TreeSet<>();
             Desktop d = tool.getDesktop();
             Tool[] tools = d.getTools();
             if (tools != null) {
                 for (int i = 0; i < tools.length; i++) {
                     Tool t = tools[i];

    @@ -289,11 +289,11 @@
             }
             cfField.setSelectedItem(cfp);
         }

         private void updateConfigFileChoices() {
    -        SortedSet s = new TreeSet();
    +        SortedSet<String> s = new TreeSet<>();
             String wdp = (String) (wdField.getSelectedItem());
             try {
                 WorkDirectory wd = WorkDirectory.open(new File(wdp));
                 FileHistory history = FileHistory.getFileHistory(wd, "configHistory.jtl");
                 File[] entries = history.getRecentEntries(10);

    @@ -304,14 +304,14 @@
                 // ignore
             }
             setItems(cfField, s);
         }

    -    private void setItems(JComboBox field, SortedSet s) {
    +    private void setItems(JComboBox<String> field, SortedSet<String> s) {
             // first, remove unwanted entries from field
             for (int i = field.getItemCount() - 1; i >= 0; i-- ) {
    -            String item = (String) (field.getItemAt(i));
    +            String item =  field.getItemAt(i);
                 if (s.contains(item)) {
                     // this item is required, so remove it from the
                     // set to be added later
                     s.remove(item);
                 }

    @@ -319,27 +319,27 @@
                     // this item is not required, remove it
                     field.removeItemAt(i);
             }

             // those items remaining in s need to be added to the field
    -        for (Iterator iter = s.iterator(); iter.hasNext(); )
    +        for (Iterator<String> iter = s.iterator(); iter.hasNext(); )
                 field.addItem(iter.next());
         }

         private Tool tool;
         private ActionListener okListener;
         private JPanel body;

    -    private JComboBox tsField;
    +    private JComboBox<String> tsField;
         private JButton tsBtn;
         private TestSuiteChooser testSuiteChooser;

    -    private JComboBox wdField;
    +    private JComboBox<String> wdField;
         private JButton wdBtn;
         private WorkDirChooser workDirChooser;

    -    private JComboBox cfField;
    +    private JComboBox<String> cfField;
         private JButton cfBtn;
         private JFileChooser configFileChooser;

         private Listener listener;

< prev index next >