changeset 141:3988a50a0d5d

7902208: Follow-up generification and misc, part 2 Reviewed-by: jjg
author dbessono
date Wed, 11 Jul 2018 20:44:47 +0100
parents 6378e05a5c34
children 05dd6e13d1f1
files src/com/sun/javatest/ExcludeList.java src/com/sun/javatest/Harness.java src/com/sun/javatest/InterviewPropagator.java src/com/sun/javatest/ObservableTestFilter.java src/com/sun/javatest/TRT_TreeNode.java src/com/sun/javatest/TestEnvContext.java src/com/sun/javatest/TestEnvironment.java src/com/sun/javatest/TestFinderQueue.java src/com/sun/javatest/TestResult.java src/com/sun/javatest/TestResultTable.java src/com/sun/javatest/agent/ActiveAgentPool.java src/com/sun/javatest/agent/Agent.java src/com/sun/javatest/agent/AgentManager.java src/com/sun/javatest/exec/BasicCustomTestFilter.java src/com/sun/javatest/exec/FilterConfig.java src/com/sun/javatest/exec/FilterSelectionHandler.java src/com/sun/javatest/exec/MonitorState.java src/com/sun/javatest/exec/NewReportDialog.java src/com/sun/javatest/exec/TT_NodeCache.java src/com/sun/javatest/exec/TestTree.java src/com/sun/javatest/exec/TestTreeModel.java src/com/sun/javatest/exec/TestTreePanel.java src/com/sun/javatest/finder/ChameleonTestFinder.java src/com/sun/javatest/finder/HTMLTestFinder.java src/com/sun/javatest/httpd/JThttpProvider.java src/com/sun/javatest/httpd/ProviderRegistry.java src/com/sun/javatest/lib/ProcessCommand.java src/com/sun/javatest/mrep/FilesPane.java src/com/sun/javatest/mrep/Merger.java src/com/sun/javatest/mrep/OptionsPane.java src/com/sun/javatest/mrep/XMLReportReader.java src/com/sun/javatest/report/StatisticsSection.java src/com/sun/javatest/tool/CommandContext.java src/com/sun/javatest/tool/ManagerLoader.java src/com/sun/javatest/tool/Preferences.java src/com/sun/javatest/tool/SDIDeskView.java src/com/sun/javatest/tool/Tool.java src/com/sun/javatest/tool/ToolAction.java src/com/sun/javatest/util/DynamicArray.java src/com/sun/javatest/util/HelpTree.java src/com/sun/javatest/util/Properties.java src/com/sun/javatest/util/SysEnv.java
diffstat 42 files changed, 179 insertions(+), 181 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/sun/javatest/ExcludeList.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/ExcludeList.java	Wed Jul 11 20:44:47 2018 +0100
@@ -479,7 +479,7 @@
                     table.remove(key);
             }
             else {
-                Entry[] o2 = (Entry[])DynamicArray.remove((Entry[])o, e);
+                Entry[] o2 = DynamicArray.remove((Entry[])o, e);
                 if (o2 == o)
                     // not found
                     return;
--- a/src/com/sun/javatest/Harness.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/Harness.java	Wed Jul 11 20:44:47 2018 +0100
@@ -969,11 +969,11 @@
         void addObserver(Observer o) {
             if (o == null)
                 throw new NullPointerException();
-            observers = (Observer[])DynamicArray.append(observers, o);
+            observers = DynamicArray.append(observers, o);
         }
 
         void removeObserver(Observer o) {
-            observers = (Observer[])DynamicArray.remove(observers, o);
+            observers = DynamicArray.remove(observers, o);
         }
 
         public void startingTestRun(Parameters params) {
--- a/src/com/sun/javatest/InterviewPropagator.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/InterviewPropagator.java	Wed Jul 11 20:44:47 2018 +0100
@@ -80,7 +80,7 @@
             InputStream in = null;
             PrintStream psConflicts = null;
             PrintStream psUpdates = null;
-            boolean needToSave1=false, needToSave2=false;
+            boolean needToSave1 = false, needToSave2 = false;
 
             Map<String, String> templateData = new HashMap<>();
 
@@ -91,10 +91,10 @@
 
                 fireEvent(EventType.TemplateLoaded, templateData);
             } catch (FileNotFoundException ex) {
-                notifyError(i18n.getString("tmpltProp.tmpFileError", new String[] {interview.getTemplatePath()}));
+                notifyError(i18n.getString("tmpltProp.tmpFileError", new String[]{interview.getTemplatePath()}));
                 logException(ex);
             } catch (IOException ex) {
-                notifyError(i18n.getString("tmpltProp.tmpFileError", new String[] {interview.getTemplatePath()}));
+                notifyError(i18n.getString("tmpltProp.tmpFileError", new String[]{interview.getTemplatePath()}));
                 logException(ex);
             }
 
@@ -113,7 +113,7 @@
                 needToSave2 = processNotUpdatableKeys(templateData, interview);
 
                 // don't optimize this expression! both of methods must be invoked
-                if(needToSave1 || needToSave2) {
+                if (needToSave1 || needToSave2) {
                     // save to file!
                     saveInterview();
                 }
@@ -157,7 +157,7 @@
                     logException(ex);
                 }
             }
-            if(needToSave1 || needToSave2 || pm.hasConflicts() || pm.hasUpdates())
+            if (needToSave1 || needToSave2 || pm.hasConflicts() || pm.hasUpdates())
                 fireEvent(EventType.Finish, null);
         }
         cleanup();
@@ -172,13 +172,13 @@
         boolean wasUpdate = false;
         for (Object key : templateData.keySet()) {
             String templateKey = (String) key;
-            if(!isSystemIgnorableTemplateProperty(templateKey) && !this.interview.isUpdatableKey(templateKey)) {
+            if (!isSystemIgnorableTemplateProperty(templateKey) && !this.interview.isUpdatableKey(templateKey)) {
                 String newTV = templateData.get(templateKey);
                 String oldTV = interview.retrieveTemplateProperty(templateKey);
                 if (oldTV != null &&
                         !oldTV.equals(newTV)) {
                     wasUpdate = true;
-                    interview.storeTemplateProperty(templateKey,  newTV);
+                    interview.storeTemplateProperty(templateKey, newTV);
                 }
             }
         }
@@ -189,7 +189,7 @@
         Iterator keys = templateData.keySet().iterator();
         boolean updated = false;
         while (keys.hasNext()) {
-            String questionKey = (String)keys.next();
+            String questionKey = (String) keys.next();
             if (!interview.isUpdatableKey(questionKey)) {
                 continue;
             }
@@ -211,7 +211,7 @@
                 boolean currentQuestionUpdated = false;
                 Properties2 oldValuesMap = new Properties2();
                 while (itt.hasNext()) {
-                    String subKey = (String)itt.next();
+                    String subKey = (String) itt.next();
                     if (interview.isAutoUpdatableKey(questionKey, subKey) ||
                             !actualProps.containsKey(subKey)) {
                         String templateSubValue = templateProps.getProperty(subKey);
@@ -246,8 +246,8 @@
                     pq.setValue(sw.toString());
                     interview.setEdited(true);
                     updated = true;
-                    String [] data = new String[] {sw.toString(), swOld.toString(), swOld.toString(),
-                    getQuestionText(questionKey, allQuestionMap)};
+                    String[] data = new String[]{sw.toString(), swOld.toString(), swOld.toString(),
+                            getQuestionText(questionKey, allQuestionMap)};
                     pm.partialUpdateMap.put(questionKey, data);
                 }
             }
@@ -258,8 +258,8 @@
     private void processQuestionFromSet(Map<String, String> templateData, Map<String, Question> allQ, Set keySet, Map<String, String> actual) {
         Iterator keys = keySet.iterator();
         while (keys.hasNext()) {
-            String questionKey = (String)keys.next();
-            if (! isIgnorableTemplateProperty(questionKey)) {
+            String questionKey = (String) keys.next();
+            if (!isIgnorableTemplateProperty(questionKey)) {
                 String templateV = templateData.get(questionKey);
                 String oldTemplateV = interview.retrieveTemplateProperty(questionKey);
                 String configurationV = actual.get(questionKey);
@@ -296,7 +296,7 @@
 
 
     private boolean isFromTemplate() {
-        return ! interview.isTemplate() && interview.getTemplatePath() != null;
+        return !interview.isTemplate() && interview.getTemplatePath() != null;
     }
 
     private String getQuestionText(String key, Map<String, Question> allQ) {
@@ -312,6 +312,7 @@
 
     /**
      * Gets current PropogateMap
+     *
      * @return InterviewPropagator.PropogateMap with actual data
      */
     public InterviewPropagator.PropogateMap getPropagateMap() {
@@ -356,7 +357,7 @@
     }
 
     // autoupdatable values
-    private void updateAll()  {
+    private void updateAll() {
         InterviewPropagator.PropogateMap pm = getPropagateMap();
         if (pm.hasUpdates()) {
             Map<String, String[]> map = pm.updateMap;
@@ -381,7 +382,7 @@
     }
 
 
-    private void acceptTemplateDatafromMap(final Map<String, String[]> map, boolean  templateOnly) {
+    private void acceptTemplateDatafromMap(final Map<String, String[]> map, boolean templateOnly) {
         Iterator<String> it = map.keySet().iterator();
         while (it.hasNext()) {
             String key = it.next();
@@ -436,6 +437,7 @@
 
     /**
      * Converts string representation of property question to Properties2 object
+     *
      * @param str - string representation of property question
      * @return corresponding Properties2 object
      * @throws IOException
@@ -451,10 +453,11 @@
     /**
      * Properties2 object to its string representation.
      * Used for property question processing
+     *
      * @param pr - Properties2 object
      * @return corresponding string representation
      */
-    public static String properties2ToString(Properties2 pr)  {
+    public static String properties2ToString(Properties2 pr) {
         StringWriter sw = new StringWriter();
         pr.save(sw, null);
         return sw.toString();
@@ -462,7 +465,8 @@
 
     /**
      * Returns is the specified question is properties question
-     * @param key - question key
+     *
+     * @param key       - question key
      * @param interview - InterviewParameters object
      * @return true if the specified question is properties question, otherwise false
      */
@@ -472,7 +476,8 @@
 
     /**
      * Returns is the specified question is properties question
-     * @param key - question key
+     *
+     * @param key  - question key
      * @param allQ - question map
      * @return true if the specified question is properties question, otherwise false
      */
@@ -485,7 +490,6 @@
     }
 
 
-
     /**
      * Propagation data model.
      */
@@ -508,9 +512,9 @@
         private void add(Map<String, String[]> aMap, String key, String templV, String oldTemplV, String confV, String questionText, boolean isPropQ, Map<String, String[]> updateMap) {
 
 
-            if (templV != null ) {
-                String [] data = new String[] {templV, oldTemplV, confV, questionText};
-                String [] comp_data = data;
+            if (templV != null) {
+                String[] data = {templV, oldTemplV, confV, questionText};
+                String[] comp_data = data;
                 boolean added = false;
                 boolean isUpdate = false;
                 if (isPropQ) {
@@ -521,21 +525,21 @@
 
                 // is it "new template value" ?
                 if (comp_data[OLD_TEMPLATE] == null && !comp_data[NEW_TEMPLATE].equals(comp_data[CONFIGURATION])) {
-                    comp_data[OLD_TEMPLATE] = notAvailable ;
+                    comp_data[OLD_TEMPLATE] = notAvailable;
                     if (comp_data[CONFIGURATION] == null) comp_data[CONFIGURATION] = notAvailable;
-                    updateMap.put(key, data );
+                    updateMap.put(key, data);
                     isUpdate = added = true;
 
-                // is it "simple template update with no conflicts" ?
+                    // is it "simple template update with no conflicts" ?
                 } else if (comp_data[OLD_TEMPLATE] != null && comp_data[CONFIGURATION] != null) {
                     if (!comp_data[NEW_TEMPLATE].equals(comp_data[CONFIGURATION]) &&
                             comp_data[OLD_TEMPLATE].equals(comp_data[CONFIGURATION])) {
-                        updateMap.put(key, data );
+                        updateMap.put(key, data);
                         isUpdate = added = true;
                     } else if (!comp_data[NEW_TEMPLATE].equals(comp_data[CONFIGURATION]) &&
                             !comp_data[NEW_TEMPLATE].equals(comp_data[OLD_TEMPLATE])) {
                         // cases 1 and 3, notify and ask user
-                        aMap.put(key,  data);
+                        aMap.put(key, data);
                         added = true;
                     } else if (!comp_data[NEW_TEMPLATE].equals(comp_data[CONFIGURATION]) &&
                             comp_data[NEW_TEMPLATE].equals(comp_data[OLD_TEMPLATE])) {
@@ -543,7 +547,7 @@
                         //
                     } else if (!comp_data[NEW_TEMPLATE].equals(comp_data[OLD_TEMPLATE])) {
                         // case 2 notify and show user
-                        aMap.put(key, data );
+                        aMap.put(key, data);
                         added = true;
                     }
                 }
@@ -587,7 +591,7 @@
 
         private void makeReport(PrintStream sw, Map<String, String[]> m, boolean hideOldTemplate) {
             Iterator<String> it = m.keySet().iterator();
-            if (! it.hasNext()) {
+            if (!it.hasNext()) {
                 return;
             }
             try {
@@ -635,29 +639,29 @@
 
                 while (it.hasNext()) {
                     String key = it.next();
-                    String [] data = m.get(key);
+                    String[] data = m.get(key);
                     writer.startTag(HTMLWriterEx.TR);
                     writer.startTag(HTMLWriterEx.TD);
                     writer.writeAttr("class", "pname");
-                    writer.writeAttr("colspan", hideOldTemplate? 2:3);
+                    writer.writeAttr("colspan", hideOldTemplate ? 2 : 3);
                     writer.startTag(HTMLWriterEx.HR);
                     writer.write(data[QUESTION_TEXT]);
                     writer.endTag(HTMLWriterEx.TD);
                     writer.endTag(HTMLWriterEx.TR);
 
                     String[] s;
-                    if(!propQs.contains(key)) {
+                    if (!propQs.contains(key)) {
                         s = new String[data.length];
-                        for(int i = 0; i < data.length; i++)
+                        for (int i = 0; i < data.length; i++)
                             s[i] = data[i];
                     } else
                         s = convertPQ(data);
 
                     writer.startTag(HTMLWriterEx.TR);
 
-                    for(int i = CONFIGURATION; i >= NEW_TEMPLATE; i--) {
+                    for (int i = CONFIGURATION; i >= NEW_TEMPLATE; i--) {
 
-                        if (i != OLD_TEMPLATE || ! hideOldTemplate) {
+                        if (i != OLD_TEMPLATE || !hideOldTemplate) {
                             writer.startTag(HTMLWriterEx.TD);
                             writer.writeAttr("class", "val");
                             writer.writeAttr("valign", "top");
@@ -673,16 +677,16 @@
                 writer.endTag(HTMLWriterEx.BODY);
                 writer.endTag(HTMLWriterEx.HTML);
                 writer.close();
-            } catch (IOException ex){
+            } catch (IOException ex) {
                 ex.printStackTrace();
             }
             // no finally block to close stream because it wasn't created here
             return;
         }
 
-        private String [] convertPQ(Object[] data) {
+        private String[] convertPQ(Object[] data) {
 
-            try{
+            try {
 
                 Properties2 oldT = InterviewPropagator.stringToProperties2((String) data[OLD_TEMPLATE]);
                 Properties2 newT = InterviewPropagator.stringToProperties2((String) data[NEW_TEMPLATE]);
@@ -690,7 +694,7 @@
 
                 HTMLWriterEx[] writers = new HTMLWriterEx[3];
                 StringWriter[] stringWriters = new StringWriter[writers.length];
-                for(int i = 0; i < writers.length; i++) {
+                for (int i = 0; i < writers.length; i++) {
                     stringWriters[i] = new StringWriter();
                     writers[i] = new HTMLWriterEx(stringWriters[i], i18n);
                     writers[i].startTag(HTMLWriterEx.TABLE);
@@ -720,7 +724,7 @@
                 }
 
                 String[] result = new String[writers.length];
-                for(int i = 0; i < writers.length; i++) {
+                for (int i = 0; i < writers.length; i++) {
                     writers[i].endTag(HTMLWriterEx.TABLE);
                     writers[i].flush();
                     result[i] = stringWriters[i].toString();
@@ -730,7 +734,7 @@
             } catch (IOException ex) {
                 logException(ex);
             }
-            return new String[] {"", "", ""};
+            return new String[]{"", "", ""};
         }
 
         private String getCSS() {
@@ -745,7 +749,7 @@
                 r = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
 
                 String line;
-                while( (line = r.readLine()) != null )
+                while ((line = r.readLine()) != null)
                     sb.append(line);
                 return sb.toString();
             } catch (IOException ex) {
@@ -806,7 +810,9 @@
 
     public interface ViewManager {
         void showView(InterviewPropagator prop, InterviewParameters interview);
+
         void logException(Throwable th, InterviewParameters interview);
+
         void notifyError(String message, InterviewParameters interview);
     }
 
@@ -835,8 +841,8 @@
     private static TestRefresher refresher;
     private InterviewParameters interview;
     private PropogateMap pm;
-    private String [] ignorableProps ;
-    private String [] ignorablePrefs ;
+    private String[] ignorableProps;
+    private String[] ignorablePrefs;
 }
 
 
--- a/src/com/sun/javatest/ObservableTestFilter.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/ObservableTestFilter.java	Wed Jul 11 20:44:47 2018 +0100
@@ -52,7 +52,7 @@
      * @param o The observer to be registered.  Should never be null.
      */
     public void addObserver(Observer o) {
-        observers = (Observer[])DynamicArray.append(observers, o);
+        observers = DynamicArray.append(observers, o);
     }
 
     /**
@@ -61,7 +61,7 @@
      * @param o The filter to be un-registered.
      */
     public void removeObserver(Observer o) {
-        observers = (Observer[])DynamicArray.remove(observers, o);
+        observers = DynamicArray.remove(observers, o);
     }
 
     /**
--- a/src/com/sun/javatest/TRT_TreeNode.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/TRT_TreeNode.java	Wed Jul 11 20:44:47 2018 +0100
@@ -51,7 +51,7 @@
         TestResultTable.TreeNodeObserver[] observers = observerTable.get(this);
 
         if (observers == null) observers = new TestResultTable.TreeNodeObserver[0];
-        observers = (TestResultTable.TreeNodeObserver[])(DynamicArray.append(observers, obs));
+        observers = DynamicArray.append(observers, obs);
         observerTable.put(this, observers);
     }
 
@@ -63,7 +63,7 @@
         if (observers == null)
             return;
 
-        observers = (TestResultTable.TreeNodeObserver[])(DynamicArray.remove(observers, obs));
+        observers = DynamicArray.remove(observers, obs);
         if (observers == null)
             observerTable.remove(this);
         else
@@ -1416,7 +1416,7 @@
 
         // if no conflicts were found, append it
         if (node.filesToScan == null || i >= node.filesToScan.length)
-            node.filesToScan = (String[])DynamicArray.append(node.filesToScan, file);
+            node.filesToScan = DynamicArray.append(node.filesToScan, file);
         else {
             // name collision, ignore
             // actually, with scan suppression, this may be normal
--- a/src/com/sun/javatest/TestEnvContext.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/TestEnvContext.java	Wed Jul 11 20:44:47 2018 +0100
@@ -68,7 +68,7 @@
      */
     public TestEnvContext(File[] files) throws Fault {
         Vector<String> n = new Vector<>();
-        Vector<Map> p = new Vector<>();
+        Vector<Map<String, String>> p = new Vector<>();
         try {
             if (files != null) {
                 for (int i = 0; i < files.length; i++) {
@@ -95,7 +95,7 @@
      */
     public TestEnvContext(Map[] tables, String[] tableNames) {
         Vector<String> n = new Vector<>();
-        Vector<Map> p = new Vector<>();
+        Vector<Map<String, String>> p = new Vector<>();
         for (int i = 0; i < tables.length; i++) {
             add(p, n, tables[i], tableNames[i]);
         }
@@ -114,7 +114,7 @@
      */
     public TestEnvContext(Map table, String tableName) {
         Vector<String> n = new Vector<>();
-        Vector<Map> p = new Vector<>();
+        Vector<Map<String, String>> p = new Vector<>();
         add(p, n, table, tableName);
         propTables = new Map[p.size()];
         p.copyInto(propTables);
@@ -177,14 +177,13 @@
         return envMenuNames;
     }
 
-    private Map load(File f) throws Fault {
+    private Map<String, String> load(File f) throws Fault {
         if (f == null)
             return null;
 
         try {
-            Properties p = new Properties();
-            Reader in = new BufferedReader(new InputStreamReader(new FileInputStream(f), StandardCharsets.UTF_8));
-            p.load(in);
+            InputStream in = new BufferedInputStream(new FileInputStream(f));
+            Map<String, String> p = Properties.load(in);
             in.close();
 
             /*
@@ -227,7 +226,7 @@
         */
     }
 
-    private void add(Vector<Map> pv, Vector<String> nv, Map p, String n) {
+    private void add(Vector<Map<String, String>> pv, Vector<String> nv, Map<String, String> p, String n) {
         if (p != null) {
             pv.addElement(p);
             nv.addElement(n);
@@ -246,8 +245,8 @@
         // if there are defaults, merge them with the TestEnvContext tables
         // for the purposes of determining the EnvTable
         if (defaultTables != null && defaultTables.length > 0) {
-            tables = (Map[]) (DynamicArray.join(defaultTables, tables));
-            tableNames = (String[]) (DynamicArray.join(defaultTableNames, tableNames));
+            tables = DynamicArray.join(defaultTables, tables);
+            tableNames = DynamicArray.join(defaultTableNames, tableNames);
         }
 
         Vector<String> allVec = new Vector<>();
--- a/src/com/sun/javatest/TestEnvironment.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/TestEnvironment.java	Wed Jul 11 20:44:47 2018 +0100
@@ -88,8 +88,8 @@
             throw new NullPointerException();
 
         //System.err.println("TEC: add default propTable " + name);
-        defaultPropTableNames = (String[]) (DynamicArray.append(defaultPropTableNames, name));
-        defaultPropTables = (Map[]) (DynamicArray.append(defaultPropTables, propTable));
+        defaultPropTableNames = DynamicArray.append(defaultPropTableNames, name);
+        defaultPropTables = DynamicArray.append(defaultPropTables, propTable);
     }
 
     /**
@@ -138,8 +138,8 @@
     {
         this.name = name;
         if (defaultPropTables != null && defaultPropTables.length > 0) {
-            propTables = (Map[]) (DynamicArray.join(defaultPropTables, propTables));
-            propTableNames = (String[]) (DynamicArray.join(defaultPropTableNames, propTableNames));
+            propTables = DynamicArray.join(defaultPropTables, propTables);
+            propTableNames = DynamicArray.join(defaultPropTableNames, propTableNames);
         }
 
         // First, figure out the inheritance chain
--- a/src/com/sun/javatest/TestFinderQueue.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/TestFinderQueue.java	Wed Jul 11 20:44:47 2018 +0100
@@ -628,11 +628,11 @@
 
     private static class Notifier implements Observer {
         public synchronized void addObserver(Observer o) {
-            observers = (Observer[])DynamicArray.append(observers, o);
+            observers = DynamicArray.append(observers, o);
         }
 
         public synchronized void removeObserver(Observer o) {
-            observers = (Observer[])DynamicArray.remove(observers, o);
+            observers = DynamicArray.remove(observers, o);
         }
 
         public synchronized void found(File file) {
--- a/src/com/sun/javatest/TestResult.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/TestResult.java	Wed Jul 11 20:44:47 2018 +0100
@@ -288,7 +288,7 @@
                     checkMutable();
 
                     OutputBuffer b = new WritableOutputBuffer(name);
-                    buffers = (OutputBuffer[])(DynamicArray.append(buffers, b));
+                    buffers = DynamicArray.append(buffers, b);
 
                     notifyCreatedOutput(this, name);
 
@@ -398,7 +398,7 @@
 
             while ((line = in.readLine()).startsWith(JTR_V2_SECTSTREAM)) {
                 OutputBuffer b = new FixedOutputBuffer(line, in);
-                buffers = (OutputBuffer[])(DynamicArray.append(buffers, b));
+                buffers = DynamicArray.append(buffers, b);
             }
 
             // if not in the message section, line should have the section result
@@ -522,7 +522,7 @@
             if (name.equals(MESSAGE_OUTPUT_NAME))
                 name = MESSAGE_OUTPUT_NAME;
             OutputBuffer b = new FixedOutputBuffer(name, data);
-            buffers = (OutputBuffer[])(DynamicArray.append(buffers, b));
+            buffers = DynamicArray.append(buffers, b);
         }
 
         /**
@@ -928,7 +928,7 @@
         }
 
         Section section = new Section(name);
-        sections = (Section[])(DynamicArray.append(sections, section));
+        sections = DynamicArray.append(sections, section);
         notifyCreatedSection(section);
         // avoid creating output (which will cause observer messages)
         // before the createdSection has been notified
@@ -1710,7 +1710,7 @@
 
             if (observers == null) observers = new Observer[0];
 
-            observers = (Observer[])(DynamicArray.append(observers, obs));
+            observers = DynamicArray.append(observers, obs);
             observersTable.put(this, observers);
         }
     }
@@ -1724,7 +1724,7 @@
         if (observers == null)
             return;
 
-        observers = (Observer[])(DynamicArray.remove(observers, obs));
+        observers = DynamicArray.remove(observers, obs);
         if (observers == null)
             observersTable.remove(this);
         else
@@ -2140,7 +2140,7 @@
                 Section blk = processOldSection(line, in);
 
                 if (blk != null) {
-                    sections = (Section[])(DynamicArray.append(sections, blk));
+                    sections = DynamicArray.append(sections, blk);
                 }
             }
             else if (line.startsWith(JTR_V1_TSTRESULT)) {
--- a/src/com/sun/javatest/TestResultTable.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/TestResultTable.java	Wed Jul 11 20:44:47 2018 +0100
@@ -1158,7 +1158,7 @@
     public synchronized void addObserver(Observer o) {
         if (o == null)
             throw new NullPointerException();
-        observers = (Observer[])DynamicArray.append(observers, o);
+        observers = DynamicArray.append(observers, o);
     }
 
     /**
@@ -1168,7 +1168,7 @@
      * @param o The observer to remove.
      */
     public synchronized void removeObserver(Observer o) {
-        observers = (Observer[])DynamicArray.remove(observers, o);
+        observers = DynamicArray.remove(observers, o);
     }
 
     /**
@@ -1177,7 +1177,7 @@
      * @param obs The observer to attach.  Must never be null.
      */
     public void addObserver(TreeObserver obs) {
-        treeObservers = (TreeObserver[])DynamicArray.append(treeObservers, obs);
+        treeObservers = DynamicArray.append(treeObservers, obs);
     }
 
     /**
@@ -1188,7 +1188,7 @@
      */
     public void removeObserver(TreeObserver obs) {
         if (treeObservers != null)
-            treeObservers = (TreeObserver[])(DynamicArray.remove(treeObservers, obs));
+            treeObservers = DynamicArray.remove(treeObservers, obs);
     }
 
     /**
@@ -1681,7 +1681,7 @@
             // in the test suite.
             TestResult oldTR = node.addChild(tr, suppressScan, !cacheInitialized);
             //tr.setParent(node);   // now done in TRT_TreeNode.addChild()
-            rec = (TRT_TreeNode[])DynamicArray.append(rec, node);
+            rec = DynamicArray.append(rec, node);
 
             // index will be -1 if the node insertion was rejected
             // perhaps upgrade the code so that addChild() throws and
@@ -1762,13 +1762,13 @@
                 tn.setName(getDirName(nextDir));
                 node.addChild(tn, suppressScan);
 
-                rec = (TRT_TreeNode[])DynamicArray.append(rec, tn);
+                rec = DynamicArray.append(rec, tn);
                 notifyNewBranch(rec, tn, node.getIndex(tn, suppressScan));
 
                 return insert(tn, newPath, tr, rec, suppressScan);
             }
             else {                  // no work, just recurse
-                rec = (TRT_TreeNode[])DynamicArray.append(rec, node);
+                rec = DynamicArray.append(rec, node);
                 return insert(next, newPath, tr, rec, suppressScan);
             }
 
@@ -2809,7 +2809,7 @@
         void addNode(TreeNode tn) {
             if (tr != null) throw new JavaTestError(i18n, "trt.invalidPath");
 
-            nodes = (TreeNode[])DynamicArray.append(nodes, tn);
+            nodes = DynamicArray.append(nodes, tn);
         }
 
 /*
@@ -2866,7 +2866,7 @@
             TreeNode node = tr.getParent();
 
             while (node != null) {
-                nodes = (TreeNode[])DynamicArray.insert(nodes, node, 0);
+                nodes = DynamicArray.insert(nodes, node, 0);
                 node = node.getParent();
             }
 
--- a/src/com/sun/javatest/agent/ActiveAgentPool.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/agent/ActiveAgentPool.java	Wed Jul 11 20:44:47 2018 +0100
@@ -375,12 +375,12 @@
         }
 
         synchronized void addObserver(Observer o) {
-            observers = (Observer[])(DynamicArray.append(observers, o));
+            observers = DynamicArray.append(observers, o);
         }
 
 
         synchronized void deleteObserver(Observer o) {
-            observers = (Observer[])(DynamicArray.remove(observers, o));
+            observers = DynamicArray.remove(observers, o);
         }
 
         private synchronized void notifyAddedToPool(Entry e) {
--- a/src/com/sun/javatest/agent/Agent.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/agent/Agent.java	Wed Jul 11 20:44:47 2018 +0100
@@ -451,11 +451,11 @@
 
     private class Notifier {
         public synchronized void addObserver(Observer o) {
-            observers = (Observer[])(DynamicArray.append(observers, o));
+            observers = DynamicArray.append(observers, o);
         }
 
         public synchronized void removeObserver(Agent.Observer o) {
-            observers = (Observer[])(DynamicArray.remove(observers, o));
+            observers = DynamicArray.remove(observers, o);
         }
 
         public synchronized void started() {
--- a/src/com/sun/javatest/agent/AgentManager.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/agent/AgentManager.java	Wed Jul 11 20:44:47 2018 +0100
@@ -107,7 +107,7 @@
      * @see #removeObserver
      */
     public synchronized void addObserver(Observer o) {
-        observers = (Observer[])(DynamicArray.append(observers, o));
+        observers = DynamicArray.append(observers, o);
     }
 
     /**
@@ -115,7 +115,7 @@
      * @param o         The observer to be removed.
      */
     public synchronized void removeObserver(Observer o) {
-        observers = (Observer[])(DynamicArray.remove(observers, o));
+        observers = DynamicArray.remove(observers, o);
     }
 
     private synchronized void notifyStarted(Connection connection,
--- a/src/com/sun/javatest/exec/BasicCustomTestFilter.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/exec/BasicCustomTestFilter.java	Wed Jul 11 20:44:47 2018 +0100
@@ -124,12 +124,12 @@
     // must be notified of changes
     @Override
     public void addObserver(Observer o) {
-        obs = (Observer[]) DynamicArray.append(obs, o);
+        obs = DynamicArray.append(obs, o);
     }
 
     @Override
     public void removeObserver(Observer o) {
-        obs = (Observer[]) DynamicArray.remove(obs, o);
+        obs = DynamicArray.remove(obs, o);
     }
 
     @Override
--- a/src/com/sun/javatest/exec/FilterConfig.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/exec/FilterConfig.java	Wed Jul 11 20:44:47 2018 +0100
@@ -102,7 +102,7 @@
             return;
 
         // record this filter officially
-        filters = (TestFilter[])DynamicArray.append(filters, f);
+        filters = DynamicArray.append(filters, f);
 
         // register as change observer if possible
         if (f instanceof ObservableTestFilter) {
@@ -135,7 +135,7 @@
             return;
 
         // remove this filter officially
-        filters = (TestFilter[])DynamicArray.remove(filters, f);
+        filters = DynamicArray.remove(filters, f);
 
         if (f instanceof ObservableTestFilter)
             ((ObservableTestFilter)f).removeObserver(listener);
@@ -202,7 +202,7 @@
 
     synchronized FilterSelectionHandler createFilterSelectionHandler() {
         FilterSelectionHandler fsh = new FilterSelectionHandler(this, uif);
-        handlers = (FilterSelectionHandler[])DynamicArray.append(handlers, fsh);
+        handlers = DynamicArray.append(handlers, fsh);
 
         return fsh;
     }
@@ -214,11 +214,11 @@
         if (obs == null)
             obs = new Observer[0];
 
-        obs = (Observer[])DynamicArray.append(obs, o);
+        obs = DynamicArray.append(obs, o);
     }
 
     public synchronized void removeObserver(Observer o) {
-        obs = (Observer[])DynamicArray.remove(obs, o);
+        obs = DynamicArray.remove(obs, o);
     }
 
     /**
--- a/src/com/sun/javatest/exec/FilterSelectionHandler.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/exec/FilterSelectionHandler.java	Wed Jul 11 20:44:47 2018 +0100
@@ -90,11 +90,11 @@
         if (obs == null)
             obs = new Observer[0];
 
-        obs = (Observer[])DynamicArray.append(obs, o);
+        obs = DynamicArray.append(obs, o);
     }
 
     public void removeObserver(Observer o) {
-        obs = (Observer[])DynamicArray.remove(obs, o);
+        obs = DynamicArray.remove(obs, o);
     }
 
     /**
--- a/src/com/sun/javatest/exec/MonitorState.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/exec/MonitorState.java	Wed Jul 11 20:44:47 2018 +0100
@@ -82,11 +82,11 @@
     }
 
     void addObserver(Observer o) {
-        obs = (Observer[])DynamicArray.append(obs, o);
+        obs = DynamicArray.append(obs, o);
     }
 
     void removeObserver(Observer o) {
-        obs = (Observer[])DynamicArray.remove(obs, o);
+        obs = DynamicArray.remove(obs, o);
     }
 
     /**
--- a/src/com/sun/javatest/exec/NewReportDialog.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/exec/NewReportDialog.java	Wed Jul 11 20:44:47 2018 +0100
@@ -172,11 +172,11 @@
     }
 
     void addObserver(Observer o) {
-        obs = (Observer[])DynamicArray.append(obs, o);
+        obs = DynamicArray.append(obs, o);
     }
 
     void removeObserver(Observer o) {
-        obs = (Observer[])DynamicArray.remove(obs, o);
+        obs = DynamicArray.remove(obs, o);
     }
 
     // Notify the observers that a change has been made.
--- a/src/com/sun/javatest/exec/TT_NodeCache.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/exec/TT_NodeCache.java	Wed Jul 11 20:44:47 2018 +0100
@@ -546,7 +546,7 @@
         }
 
         if (obs != null) {
-            observers = (TT_NodeCacheObserver[]) DynamicArray.append(observers, obs);
+            observers = DynamicArray.append(observers, obs);
         }
 
         return cp;
@@ -557,7 +557,7 @@
     // THEN itself (the GUI component) for proper locking sequence, since the
     // highest contention is for this cache object.
     synchronized void removeObserver(TT_NodeCacheObserver obs) {
-        observers = (TT_NodeCacheObserver[]) DynamicArray.remove(observers, obs);
+        observers = DynamicArray.remove(observers, obs);
     }
 
     // ------------- PRIVATE -----------------
--- a/src/com/sun/javatest/exec/TestTree.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/exec/TestTree.java	Wed Jul 11 20:44:47 2018 +0100
@@ -180,7 +180,7 @@
             if (!isExpanded(tp))    // if it's not expanded, we don't need it
                 continue;
 
-            paths = (TreePath[])DynamicArray.append(paths, tp);
+            paths = DynamicArray.append(paths, tp);
         }   // while
 
         return paths;
--- a/src/com/sun/javatest/exec/TestTreeModel.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/exec/TestTreeModel.java	Wed Jul 11 20:44:47 2018 +0100
@@ -118,7 +118,7 @@
 
     // TreeModel methods
     public void addTreeModelListener(TreeModelListener l) {
-        treeModelListeners = (TreeModelListener[]) DynamicArray.append(treeModelListeners, l);
+        treeModelListeners = DynamicArray.append(treeModelListeners, l);
     }
 
     public Object getChild(Object parent, int index) {
@@ -175,7 +175,7 @@
     }
 
     public void removeTreeModelListener(TreeModelListener l) {
-        treeModelListeners = (TreeModelListener[]) DynamicArray.remove(treeModelListeners, l);
+        treeModelListeners = DynamicArray.remove(treeModelListeners, l);
     }
 
     public void valueForPathChanged(TreePath path, Object newValue) {
@@ -1396,7 +1396,7 @@
 
             // switch event format if the node is the root
             if (node.isRoot() && getRoot() != null) {
-                e = new TreeModelEvent(this, new Object[]{getRoot()}, (int[]) null, (Object[]) null);
+                e = new TreeModelEvent(this, new Object[]{getRoot()}, null, null);
             } else {
                 // full path to the node, inclusive
                 //TestResultTable.TreeNode[] fp = TestResultTable.getObjectPath(node);
--- a/src/com/sun/javatest/exec/TestTreePanel.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/exec/TestTreePanel.java	Wed Jul 11 20:44:47 2018 +0100
@@ -714,9 +714,9 @@
                 Object item = what[i].getLastPathComponent();
                 if (item instanceof TT_TestNode) {
                     ackTargets[i] = ((TT_TestNode) item).getLongPath();
-                    ackNodes = (TT_TreeNode[])DynamicArray.append(ackNodes, item, TT_TreeNode.class);
+                    ackNodes = DynamicArray.append(ackNodes, (TT_TestNode)item, TT_TreeNode.class);
                 } else if (item instanceof TT_BasicNode) {
-                    ackNodes = (TT_TreeNode[])DynamicArray.append(ackNodes, item, TT_TreeNode.class);
+                    ackNodes = DynamicArray.append(ackNodes, (TT_BasicNode)item, TT_TreeNode.class);
                     TT_BasicNode tn = (TT_BasicNode) item;
                     if (tn.isRoot()) {
                         ackTargets = new String[1];
--- a/src/com/sun/javatest/finder/ChameleonTestFinder.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/finder/ChameleonTestFinder.java	Wed Jul 11 20:44:47 2018 +0100
@@ -327,7 +327,7 @@
     private boolean ignoreCase;
     private Entry currEntry;
     private ClassLoader loader;
-    private Map<String, String> excludeList = new Hashtable<>();
+    private Map<String, String> excludeList = new HashMap<>();
 
     private static final String[] excludeNames = {
         "SCCS", "deleted_files"
--- a/src/com/sun/javatest/finder/HTMLTestFinder.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/finder/HTMLTestFinder.java	Wed Jul 11 20:44:47 2018 +0100
@@ -28,6 +28,7 @@
 
 import java.io.*;
 import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Map;
 import java.util.Vector;
@@ -585,7 +586,7 @@
 
     //----------member variables------------------------------------------------
 
-    private Map<String, Integer> namesInFile = new Hashtable<>();
+    private Map<String, Integer> namesInFile = new HashMap<>();
     private Map<String, String> excludeList;
     private static final String[] excludeNames = {"SCCS", "deleted_files"};
     private Map<String, String> extensionTable;
--- a/src/com/sun/javatest/httpd/JThttpProvider.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/httpd/JThttpProvider.java	Wed Jul 11 20:44:47 2018 +0100
@@ -128,7 +128,7 @@
 
     void addRegistredURL(String url) {
         if (url != null) {
-            regURLs = (String[])DynamicArray.append(regURLs, url);
+            regURLs = DynamicArray.append(regURLs, url);
             if (debug) System.out.println("PROV-registered URL (" + url + ") in " + this);
         }
     }
@@ -136,7 +136,7 @@
     void removeRegisteredURL(String url) {
         for (int i = 0; i < regURLs.length; i++) {
             if (regURLs[i].equals(url)) {
-                regURLs = (String[])DynamicArray.remove(regURLs, i);
+                regURLs = DynamicArray.remove(regURLs, i);
                 break;
             }
         }   // for
--- a/src/com/sun/javatest/httpd/ProviderRegistry.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/httpd/ProviderRegistry.java	Wed Jul 11 20:44:47 2018 +0100
@@ -262,7 +262,7 @@
 
         boolean result;
         String file = url[0];
-        url = (String[])DynamicArray.remove(url, 0);
+        url = DynamicArray.remove(url, 0);
 
         if (debug) System.out.println("    PR-Partial insert of " + file);
 
@@ -305,7 +305,7 @@
         }
 
         String file = url[0];
-        url = (String[])DynamicArray.remove(url, 0);
+        url = DynamicArray.remove(url, 0);
 
         if (debug) System.out.println("    PR-(del)Partial remove of " + file);
 
@@ -369,7 +369,7 @@
             currC = url.charAt(pos);
             switch (currC) {
                 case '/':   if (pos > start+1)
-                                result = (String[])DynamicArray.append(result, url.substring(start, pos));
+                                result = DynamicArray.append(result, url.substring(start, pos));
                             start = pos + 1;
                             pos++;
                             break;
@@ -382,7 +382,7 @@
         }
 
         if (!done && pos >= urlLen && (pos - start) >= 1)
-            result = (String[])DynamicArray.append(result, url.substring(start, pos));
+            result = DynamicArray.append(result, url.substring(start, pos));
 
         if (debug)
             System.out.println("PR-Dissolved url " + url + " into " + result.length + " files.");
--- a/src/com/sun/javatest/lib/ProcessCommand.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/lib/ProcessCommand.java	Wed Jul 11 20:44:47 2018 +0100
@@ -401,7 +401,7 @@
         if (logStatus != null)
             return logStatus;
         else if (statusTable != null) {
-            Status s = statusTable.get(new Integer(exitCode));
+            Status s = statusTable.get(Integer.valueOf(exitCode));
             return (s == null ? defaultStatus.augment("exit code: " + exitCode) : s);
         }
         else if (exitCode == 0)
--- a/src/com/sun/javatest/mrep/FilesPane.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/mrep/FilesPane.java	Wed Jul 11 20:44:47 2018 +0100
@@ -451,7 +451,7 @@
         for (int i = 0; i < merged.size(); i++) {
             String s = merged.get(i).getText().trim();
             if (!"".equals(s)) {
-                result[l++] = merged.get(i).getText().trim();
+                result[l++] = s;
             }
         }
         return result;
--- a/src/com/sun/javatest/mrep/Merger.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/mrep/Merger.java	Wed Jul 11 20:44:47 2018 +0100
@@ -45,16 +45,16 @@
     /**
      * @param in array of files with XML reports
      * @param out file to put results
-     * @param confilctResolver ConflictResolver to resolve conflicts during merge
+     * @param conflictResolver ConflictResolver to resolve conflicts during merge
      */
-    public boolean merge(File[] in, File out, ConflictResolver confilctResolver) throws SAXException,
+    public boolean merge(File[] in, File out, ConflictResolver conflictResolver) throws SAXException,
             ParserConfigurationException, IOException{
         // Maps with statistics
         Map[] inputs = new Map[in.length];
         // read statistics
         for (int i = 0; i < in.length; i++) {
             XMLReportReader reader = new XMLReportReader();
-            Map map = reader.readIDs(in[i]);
+            Map<Object, Object> map = reader.readIDs(in[i]);
             inputs[i] = map;
         }
 
@@ -62,10 +62,10 @@
         int allCnt = 0;
         // rename id's and find conflicts
         Set<String> all = new HashSet<>();
-        List<String> confilcts = new ArrayList<>();
+        List<String> conflicts = new ArrayList<>();
         for (int i = 0; i < in.length; i++) {
             int workdirsInFile = 0;
-            Iterator it = inputs[i].keySet().iterator();
+            Iterator<Object> it = inputs[i].keySet().iterator();
             Map<Object, Object> newMap = new HashMap<>();
             while (it.hasNext()) {
                 Object o =  it.next();
@@ -79,8 +79,8 @@
                 // this is test result url
                 if (o instanceof String) {
                     String url = (String) o;
-                    if (all.contains(url) && !confilcts.contains(url)) {
-                        confilcts.add(url);
+                    if (all.contains(url) && !conflicts.contains(url)) {
+                        conflicts.add(url);
                     }
                     all.add(url);
                     TestResultDescr td = (TestResultDescr)inputs[i].get(o);
@@ -94,8 +94,8 @@
         }
 
         // resolve each conflict
-        for (int c = 0; c < confilcts.size(); c++) {
-            String url = confilcts.get(c);
+        for (int c = 0; c < conflicts.size(); c++) {
+            String url = conflicts.get(c);
             List<TestResultDescr> tds = new ArrayList<>();
             for(int i = 0; i < in.length; i++) {
                 TestResultDescr td = (TestResultDescr) inputs[i].get(url);
@@ -105,7 +105,7 @@
                 }
             }
             TestResultDescr[] tda = tds.toArray(new TestResultDescr[0]);
-            int res = confilctResolver.resolve(url, tda);
+            int res = conflictResolver.resolve(url, tda);
             if (res < 0) {
                 // cancel
                 return false;
--- a/src/com/sun/javatest/mrep/OptionsPane.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/mrep/OptionsPane.java	Wed Jul 11 20:44:47 2018 +0100
@@ -95,8 +95,7 @@
     }
 
     CustomReport[] getCustomSelected() {
-        return getActiveCustomReports().
-                toArray(new CustomReport[0]);
+        return getActiveCustomReports().toArray(new CustomReport[0]);
     }
     protected void initGUI() {
         setName("opts");
--- a/src/com/sun/javatest/mrep/XMLReportReader.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/mrep/XMLReportReader.java	Wed Jul 11 20:44:47 2018 +0100
@@ -63,7 +63,7 @@
     private static final String JAXP_SCHEMA_SOURCE =
         "http://java.sun.com/xml/jaxp/properties/schemaSource";
 
-    Map readIDs(File file) throws SAXException, IOException, ParserConfigurationException {
+    Map<Object, Object> readIDs(File file) throws SAXException, IOException, ParserConfigurationException {
         XMLReader reader = XMLReportReader.createXMLReader(true);
         IDHandler handler = new IDHandler();
         reader.setContentHandler(handler);
@@ -135,7 +135,7 @@
             }
         }
 
-        public Map getMap() {
+        public Map<Object, Object> getMap() {
             return map;
         }
     }
--- a/src/com/sun/javatest/report/StatisticsSection.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/report/StatisticsSection.java	Wed Jul 11 20:44:47 2018 +0100
@@ -57,7 +57,7 @@
         initFiles = settings.getInitialFiles();
 
         resultTable = settings.getInterview().getWorkDirectory().getTestResultTable();
-        Iterator iter =  null;
+        Iterator<TestResult> iter =  null;
         try {
             iter = (initFiles == null) ?
                         resultTable.getIterator(new TestFilter[] {settings.filter}) :
@@ -69,7 +69,7 @@
         }       // catch
 
         for (; iter.hasNext(); ) {
-            TestResult tr = (TestResult) (iter.next());
+            TestResult tr = iter.next();
 
             try {
                 Status s = tr.getStatus();
--- a/src/com/sun/javatest/tool/CommandContext.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/tool/CommandContext.java	Wed Jul 11 20:44:47 2018 +0100
@@ -194,7 +194,7 @@
      * @see #getHarnessObservers
      */
     public void addHarnessObserver(Harness.Observer o) {
-        harnessObservers = (Harness.Observer[]) (DynamicArray.append(harnessObservers, o));
+        harnessObservers = DynamicArray.append(harnessObservers, o);
     }
 
     /**
--- a/src/com/sun/javatest/tool/ManagerLoader.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/tool/ManagerLoader.java	Wed Jul 11 20:44:47 2018 +0100
@@ -210,7 +210,7 @@
             URL u = ResourceLoader.getExtUrl(new File(s));
 
             if (u != null) {
-                urls = (URL[]) (DynamicArray.append(urls, u));
+                urls = DynamicArray.append(urls, u);
                 someCPok = true;
             }
         }   // for
--- a/src/com/sun/javatest/tool/Preferences.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/tool/Preferences.java	Wed Jul 11 20:44:47 2018 +0100
@@ -106,7 +106,7 @@
                 InputStream in = new BufferedInputStream(new FileInputStream(prefsFile));
                 props = Properties.loadSorted(in);
                 in.close();
-        fileModifiedTime = prefsFile.lastModified();
+                fileModifiedTime = prefsFile.lastModified();
             }
         }
         catch (FileNotFoundException ignore) {
@@ -203,7 +203,7 @@
         if (obs == null)
             obs = new Observer[] { o };
         else
-            obs = (Observer[])DynamicArray.append(obs, o);
+            obs = DynamicArray.append(obs, o);
         observers.put(prefix, obs);
     }
 
@@ -236,7 +236,7 @@
     public void removeObserver(String prefix, Observer o) {
         Observer[] obs = observers.get(prefix);
         if (obs != null) {
-            obs = (Observer[])DynamicArray.remove(obs, o);
+            obs = DynamicArray.remove(obs, o);
             observers.put(prefix, obs);
         }
     }
--- a/src/com/sun/javatest/tool/SDIDeskView.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/tool/SDIDeskView.java	Wed Jul 11 20:44:47 2018 +0100
@@ -170,7 +170,7 @@
             public void windowClosed(WindowEvent e) {
                 JFrame f = (JFrame) (e.getSource());
                 //removeToolMenuItemsFromFrameMenuBar(f);
-                frames = (JFrame[]) (DynamicArray.remove(frames, f));
+                frames = DynamicArray.remove(frames, f);
 
                 if (f.getContentPane() instanceof Tool) {
                     Tool t = (Tool) (f.getContentPane());
@@ -194,7 +194,7 @@
         //f.setLocation(screenSize.width/2 - size.width/2, screenSize.height/2 - size.height/2);
         f.setVisible(visible);
 
-        frames = (JFrame[]) (DynamicArray.append(frames, f));
+        frames = DynamicArray.append(frames, f);
 
         t.setDeskView(this);
 
@@ -206,7 +206,7 @@
     public void removeTool(Tool t) {
         //System.err.println("SDI: remove " + t);
         JFrame f = getFrameForTool(t);
-        frames = (JFrame[]) (DynamicArray.remove(frames, f));    // remove it from list of frames
+        frames = DynamicArray.remove(frames, f);    // remove it from list of frames
         f.setVisible(false);                          // hide it before we start disassembling it
 
         removeToolMenuItemsFromFrameMenuBar(f, t);
--- a/src/com/sun/javatest/tool/Tool.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/tool/Tool.java	Wed Jul 11 20:44:47 2018 +0100
@@ -83,7 +83,7 @@
      * @see #removeObserver
      */
     synchronized public void addObserver(Observer o) {
-        observers = (Observer[])DynamicArray.append(observers, o);
+        observers = DynamicArray.append(observers, o);
     }
 
     /**
@@ -93,7 +93,7 @@
      * @see #addObserver
      */
     synchronized public void removeObserver(Observer o) {
-        observers = (Observer[])DynamicArray.remove(observers, o);
+        observers = DynamicArray.remove(observers, o);
     }
 
     //--------------------------------------------------------------------------
--- a/src/com/sun/javatest/tool/ToolAction.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/tool/ToolAction.java	Wed Jul 11 20:44:47 2018 +0100
@@ -189,7 +189,7 @@
     }
 
     public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
-        listeners = (WeakReference[]) DynamicArray.append(listeners, new WeakReference<>(listener));
+        listeners = DynamicArray.append(listeners, new WeakReference<>(listener));
     }
 
     public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
--- a/src/com/sun/javatest/util/DynamicArray.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/util/DynamicArray.java	Wed Jul 11 20:44:47 2018 +0100
@@ -48,12 +48,12 @@
      * @throws IllegalArgumentException If newObj is null.
      * @throws ArrayStoreException If there is a type mismatch between oldArr and newObj.
      */
-    public static Object[] append(Object[] oldArr, Object newObj) {
-        Object[] newArr;
+    public static <T> T[] append(T[] oldArr, T newObj) {
+        T[] newArr;
 
         if (oldArr == null) {
             if (newObj != null) {
-                newArr = (Object[])(Array.newInstance(newObj.getClass(), 1));
+                newArr = (T[])(Array.newInstance(newObj.getClass(), 1));
                 newArr[0] = newObj;
             }
             else {
@@ -61,7 +61,7 @@
             }
         }
         else {
-            newArr = (Object[])(Array.newInstance(getArrayClass(oldArr), oldArr.length+1));
+            newArr = (T[])(Array.newInstance(getArrayClass(oldArr), oldArr.length+1));
             System.arraycopy(oldArr, 0, newArr, 0, oldArr.length);
             newArr[newArr.length-1] = newObj;
         }
@@ -80,11 +80,11 @@
      * @throws IllegalArgumentException If newObj is null.
      * @throws ArrayStoreException If there is a type mismatch between oldArr and newObj.
      */
-    public static Object[] append(Object[] oldArr, Object newObj, Class arrayClass) {
-        Object[] localArr;
+    public static <T> T[] append(T[] oldArr, T newObj, Class<? extends T> arrayClass) {
+        T[] localArr;
 
         if (oldArr == null && arrayClass != null)
-            localArr = (Object[])(Array.newInstance(arrayClass, 0));
+            localArr = (T[])(Array.newInstance(arrayClass, 0));
         else
             localArr = oldArr;
 
@@ -100,7 +100,7 @@
      * the first array, containing the elements of the first array, followed
      * by the elements of the second array.
      */
-    public static Object[] join(Object[] array1, Object[] array2) {
+    public static <T> T[] join(T[] array1, T[] array2) {
         if (array1 == null)
             return array2;
 
@@ -109,7 +109,7 @@
 
         Class type = array1.getClass().getComponentType();
         int size = array1.length + array2.length;
-        Object[] newArray = (Object[]) Array.newInstance(type, size);
+        T[] newArray = (T[]) Array.newInstance(type, size);
         System.arraycopy(array1, 0, newArray, 0, array1.length);
         System.arraycopy(array2, 0, newArray, array1.length, array2.length);
         return newArray;
@@ -127,12 +127,12 @@
      *        operation.
      * @return A new array with the object inserted into it at the specified location.
      */
-    public static Object[] insert(Object[] oldArr, Object newObj, int location) {
-        Object[] newArr;
+    public static <T> T[] insert(T[] oldArr, T newObj, int location) {
+        T[] newArr;
 
         if (oldArr == null) {
             if (newObj != null) {
-                newArr = (Object[])(Array.newInstance(newObj.getClass(), 1));
+                newArr = (T[])(Array.newInstance(newObj.getClass(), 1));
                 newArr[0] = newObj;
             }
             else {
@@ -143,7 +143,7 @@
             if (location > oldArr.length)
                 throw new IllegalArgumentException("Index location too large (" + location +
                                                     ").");
-            newArr = (Object[])(Array.newInstance(getArrayClass(oldArr), oldArr.length+1));
+            newArr = (T[])(Array.newInstance(getArrayClass(oldArr), oldArr.length+1));
 
             if (location == 0) {
                 newArr[0] = newObj;
@@ -177,8 +177,8 @@
      * @exception ArrayStoreException May occur if all the objects in the
      *          array do not match.
      */
-    public static Object[] remove(Object[] oldArr, int index) {
-        Object[] newArr;
+    public static <T> T[] remove(T[] oldArr, int index) {
+        T[] newArr;
 
         if (oldArr == null)
             throw new IllegalArgumentException("Cannot remove from null array.");
@@ -188,17 +188,17 @@
         }
         else if (index == 0) {
             // chop the head
-            newArr = (Object[])(Array.newInstance(getArrayClass(oldArr), oldArr.length-1));
+            newArr = (T[])(Array.newInstance(getArrayClass(oldArr), oldArr.length-1));
             System.arraycopy(oldArr, 1, newArr, 0, oldArr.length-1);
         }
         else if (index == oldArr.length-1) {
             // chop the tail
-            newArr = (Object[])(Array.newInstance(getArrayClass(oldArr), oldArr.length-1));
+            newArr = (T[])(Array.newInstance(getArrayClass(oldArr), oldArr.length-1));
             System.arraycopy(oldArr, 0, newArr, 0, oldArr.length-1);
         }
         else {
             // chop the middle
-            newArr = (Object[])(Array.newInstance(getArrayClass(oldArr), oldArr.length-1));
+            newArr = (T[])(Array.newInstance(getArrayClass(oldArr), oldArr.length-1));
             System.arraycopy(oldArr, 0, newArr, 0, index);
             System.arraycopy(oldArr, index+1, newArr, index,
                              oldArr.length-index-1);
@@ -216,8 +216,8 @@
      * @param victim The object to remove from the array.  May be null.
      * @return Zero length array if the last element is removed.
      */
-    public static Object[] remove(Object[] oldArr, Object victim) {
-        Object[] newArr;
+    public static <T> T[] remove(T[] oldArr, T victim) {
+        T[] newArr;
 
         if (oldArr == null) {
             newArr = oldArr;
@@ -242,7 +242,7 @@
      * @param target The reference to search for; can be null.
      * @return The array index of the target.
      */
-    public static int find(Object[] arr, Object target) {
+    public static <T> int find(T[] arr, T target) {
         int index = -1;
 
         for(int i = 0; i < arr.length; i++) {
--- a/src/com/sun/javatest/util/HelpTree.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/util/HelpTree.java	Wed Jul 11 20:44:47 2018 +0100
@@ -201,7 +201,7 @@
      * @param node the node to be added to the tree
      */
     public void addNode(Node node) {
-        nodes = (Node[]) DynamicArray.append(nodes, node);
+        nodes = DynamicArray.append(nodes, node);
     }
 
     /**
--- a/src/com/sun/javatest/util/Properties.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/util/Properties.java	Wed Jul 11 20:44:47 2018 +0100
@@ -30,11 +30,6 @@
 // InputStream/OutputStream
 
 import java.io.*;
-//import java.io.InputStream;
-//import java.io.InputStreamReader;
-//import java.io.OutputStream;
-//import java.io.OutputStreamWriter;
-//import java.io.PrintStream;
 import java.util.*;
 
 /**
@@ -86,9 +81,7 @@
      */
     public static void store(Map<String, String> stringProps, OutputStream out, String comments) throws IOException {
         java.util.Properties properties = new java.util.Properties();
-        for (Map.Entry<String, String> entry: stringProps.entrySet()) {
-            properties.put(entry.getKey(), entry.getValue());
-        }
+        properties.putAll(stringProps);
         properties.store(out, comments);
     }
 
--- a/src/com/sun/javatest/util/SysEnv.java	Tue Jul 10 20:50:35 2018 +0100
+++ b/src/com/sun/javatest/util/SysEnv.java	Wed Jul 11 20:44:47 2018 +0100
@@ -94,7 +94,7 @@
      * execution context.
      * @return a map containing all the known environment variables.
      */
-    public static Map getAll() {
+    public static Map<String, String> getAll() {
         return getAll(new HashMap<String, String>());
     }
 
@@ -105,7 +105,7 @@
      * environment variables in the current execution context.
      * @return the argument map.
      */
-    public static Map getAll(Map<String, String> m) {
+    public static Map<String, String> getAll(Map<String, String> m) {
         if (values == null)
             initValues();