< prev index next >

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

Print this page

    @@ -104,14 +104,14 @@
          * @param excludeList The excludeList against which to check excluded test cases
          * @param workDir The set of results
          */
         public Audit(TestFinderQueue tfq, ExcludeList excludeList, WorkDirectory workDir)
         {
    -        Vector badChecksumTestsV = new Vector();
    -        Vector badTestDescriptionsV = new Vector();
    -        Vector badTestCaseTestsV = new Vector();
    -        Vector badTestsV = new Vector();
    +        Vector<TestResult> badChecksumTestsV = new Vector<>();
    +        Vector<TestResult> badTestDescriptionsV = new Vector<>();
    +        Vector<TestResult> badTestCaseTestsV = new Vector<>();
    +        Vector<TestDescription> badTestsV = new Vector<>();

             workDir.getTestResultTable().waitUntilReady();

             TestDescription td;
             while ((td = tfq.next()) != null) {

    @@ -134,13 +134,13 @@
                     Map trEnv = tr.getEnvironment();
                     for (Iterator i = trEnv.entrySet().iterator(); i.hasNext(); ) {
                         Map.Entry e = (Map.Entry) (i.next());
                         String key = (String) (e.getKey());
                         String value = (String) (e.getValue());
    -                    Vector allValuesForKey = (Vector)(envTable.get(key));
    +                    Vector<String> allValuesForKey = envTable.get(key);
                         if (allValuesForKey == null) {
    -                        allValuesForKey = new Vector();
    +                        allValuesForKey = new Vector<>();
                             envTable.put(key, allValuesForKey);
                         }
                         if (!allValuesForKey.contains(value))
                             allValuesForKey.addElement(value);
                     }

    @@ -167,11 +167,11 @@
                 }
             }

             for (Enumeration e = envTable.keys(); e.hasMoreElements(); ) {
                 String key = (String)(e.nextElement());
    -            Vector allValuesForKey = (Vector)(envTable.get(key));
    +            Vector allValuesForKey = envTable.get(key);
                 envCounts[allValuesForKey.size() == 1 ? 0 : 1]++;
             }

             if (badChecksumTestsV.size() > 0) {
                 badChecksumTests = new TestResult[badChecksumTestsV.size()];

    @@ -490,19 +490,19 @@
          */
         private void showEnvValues(boolean showAll) {
             out.println();
             out.print(i18n.getString("adt.envList.title"));

    -        SortedSet ss = new TreeSet();
    +        SortedSet<String> ss = new TreeSet<>();
             for (Enumeration e = envTable.keys(); e.hasMoreElements(); ) {
                 String key = (String)(e.nextElement());
                 ss.add(key);
             }

             for (Iterator iter = ss.iterator(); iter.hasNext(); ) {
                 String key = (String) (iter.next());
    -            Vector allValuesForKey = (Vector)(envTable.get(key));
    +            Vector allValuesForKey = envTable.get(key);
                 if (allValuesForKey.size() == 1) {
                     if (showAll)
                         out.println(i18n.getString("adt.envKeyValue",
                                                 new Object[] {key, allValuesForKey.elementAt(0)}));
                 }

    @@ -690,11 +690,11 @@

         private void initDateFormats() {
             // Create an array of possible date formats to parse dates in .jtr files.
             // Most likely is Unix C time in English; the array will be reordered in use
             // by moving the recently used entries to the front of the array.
    -        Vector v = new Vector();
    +        Vector<DateFormat> v = new Vector<>();

             // generic Java default
             // 10-Sep-99 3:25:11 PM
             v.addElement(DateFormat.getDateTimeInstance());
             v.addElement(DateFormat.getDateTimeInstance(DateFormat.DEFAULT,

    @@ -731,9 +731,9 @@
         private TestResult[] badChecksumTests;
         private Date earliestStart;
         private Date latestStart;
         private DateFormat[] dateFormats;

    -    private Hashtable envTable = new Hashtable();
    +    private Hashtable<String, Vector<String>> envTable = new Hashtable<>();
         private PrintStream out;
         private static I18NResourceBundle i18n = I18NResourceBundle.getBundleForClass(Audit.class);
     }

< prev index next >