diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-27 15:20:39 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-29 22:03:00 +0200 |
commit | 33ec740d1438c3dddf8e1974757ed05bb76425ca (patch) | |
tree | 37868edd825fe8f3777a077549e61f1379da7cd3 /qadevOOo/runner/stats | |
parent | 10dd7e74c551f3e252405ba0f80a2f143d9129e5 (diff) |
Java5 update - Convert Hashtable to HashMap
Change-Id: Ibb568e841ff574d5232429ce0ba99e421ed7f05c
Diffstat (limited to 'qadevOOo/runner/stats')
-rw-r--r-- | qadevOOo/runner/stats/ComplexDataBaseOutProducer.java | 4 | ||||
-rw-r--r-- | qadevOOo/runner/stats/DataBaseOutProducer.java | 18 | ||||
-rw-r--r-- | qadevOOo/runner/stats/FatDataBaseOutProducer.java | 4 | ||||
-rw-r--r-- | qadevOOo/runner/stats/OutProducerFactory.java | 10 | ||||
-rw-r--r-- | qadevOOo/runner/stats/SQLExecution.java | 26 |
5 files changed, 32 insertions, 30 deletions
diff --git a/qadevOOo/runner/stats/ComplexDataBaseOutProducer.java b/qadevOOo/runner/stats/ComplexDataBaseOutProducer.java index bb7bf2a85b28..a64e6f3cbc35 100644 --- a/qadevOOo/runner/stats/ComplexDataBaseOutProducer.java +++ b/qadevOOo/runner/stats/ComplexDataBaseOutProducer.java @@ -19,7 +19,7 @@ package stats; import share.LogWriter; import java.text.DecimalFormat; -import java.util.Hashtable; +import java.util.HashMap; import java.util.Calendar; import java.util.GregorianCalendar; @@ -30,7 +30,7 @@ import java.util.GregorianCalendar; public class ComplexDataBaseOutProducer extends DataBaseOutProducer { /** Creates a new instance of ComplexDataBaseOutProducer */ - public ComplexDataBaseOutProducer(Hashtable param) { + public ComplexDataBaseOutProducer(HashMap param) { super(param); // do we have to write debug output? Object o = param.get("DebugIsActive"); diff --git a/qadevOOo/runner/stats/DataBaseOutProducer.java b/qadevOOo/runner/stats/DataBaseOutProducer.java index 381f207904f0..e0b8e172098d 100644 --- a/qadevOOo/runner/stats/DataBaseOutProducer.java +++ b/qadevOOo/runner/stats/DataBaseOutProducer.java @@ -20,25 +20,25 @@ package stats; import share.LogWriter; import share.DescEntry; -import java.util.Hashtable; +import java.util.HashMap; /** * * @author sg128468 */ public abstract class DataBaseOutProducer implements LogWriter { - protected Hashtable mSqlInput = null; - protected Hashtable mSqlOutput = null; + protected HashMap mSqlInput = null; + protected HashMap mSqlOutput = null; protected String[] mWriteableEntryTypes = null; protected SQLExecution mSqlExec; protected boolean m_bDebug = false; /** Creates a new instance of DataBaseOutProducer - * @param param The Hashtable with test parameters + * @param param The HashMap with test parameters */ - public DataBaseOutProducer(Hashtable param) { - mSqlInput = new Hashtable(); + public DataBaseOutProducer(HashMap param) { + mSqlInput = new HashMap(); mSqlInput.putAll(param); Object o = param.get("DebugIsActive"); @@ -118,10 +118,10 @@ public abstract class DataBaseOutProducer implements LogWriter { * @param log The log writer. */ protected boolean insertEntry(DescEntry entry, LogWriter log) { - // copy the swlInput Hashtable, so it can be reset easily for the next run - Hashtable copySqlInput = new Hashtable(); + // copy the swlInput HashMap, so it can be reset easily for the next run + HashMap copySqlInput = new HashMap(); copySqlInput.putAll(mSqlInput); - // put some stuff from entry in the Hashtable + // put some stuff from entry in the HashMap mSqlInput.put("EntryLongName", entry.longName); mSqlInput.put("EntryName", entry.entryName); mSqlInput.put("EntryState", entry.State); diff --git a/qadevOOo/runner/stats/FatDataBaseOutProducer.java b/qadevOOo/runner/stats/FatDataBaseOutProducer.java index f54019226d93..88981f738247 100644 --- a/qadevOOo/runner/stats/FatDataBaseOutProducer.java +++ b/qadevOOo/runner/stats/FatDataBaseOutProducer.java @@ -19,7 +19,7 @@ package stats; import java.text.DecimalFormat; import share.LogWriter; -import java.util.Hashtable; +import java.util.HashMap; import java.util.Calendar; import java.util.GregorianCalendar; @@ -31,7 +31,7 @@ public class FatDataBaseOutProducer extends DataBaseOutProducer { /** Creates a new instance of APIDataBaseOutProducer */ - public FatDataBaseOutProducer(Hashtable param) { + public FatDataBaseOutProducer(HashMap param) { super(param); String testBase = (String)mSqlInput.get("TestBase"); int sep = testBase.indexOf('_'); diff --git a/qadevOOo/runner/stats/OutProducerFactory.java b/qadevOOo/runner/stats/OutProducerFactory.java index 1b2fe08cffa6..ffdac13b37a6 100644 --- a/qadevOOo/runner/stats/OutProducerFactory.java +++ b/qadevOOo/runner/stats/OutProducerFactory.java @@ -18,7 +18,7 @@ package stats; import share.LogWriter; -import java.util.Hashtable; +import java.util.HashMap; import util.DynamicClassLoader; /** @@ -36,7 +36,7 @@ public class OutProducerFactory { * @param Parameters of the test. * @return The created out producer. */ - public static LogWriter createOutProducer(Hashtable param) { + public static LogWriter createOutProducer(HashMap param) { LogWriter dbOut = null; boolean getDatabase = convertToBool(param.get("DataBaseOut")); if (getDatabase) { @@ -61,11 +61,11 @@ public class OutProducerFactory { } /** - * Create a databbase out producer. + * Create a database out producer. * @param The test parameters * @return The database out producer, or null if it couldn't be created. */ - public static LogWriter createDataBaseOutProducer(Hashtable param) { + public static LogWriter createDataBaseOutProducer(HashMap param) { String dataProducerName = (String)param.get("DataBaseOutProducer"); if (dataProducerName == null) { String testBaseName = (String)param.get("TestBase"); @@ -77,7 +77,7 @@ public class OutProducerFactory { LogWriter dbOut = null; try { dbOut = (LogWriter)dcl.getInstance(dataProducerName, - new Class[]{new Hashtable().getClass()}, new Object[]{param}); + new Class[]{new HashMap().getClass()}, new Object[]{param}); } catch(IllegalArgumentException e) { e.printStackTrace(); diff --git a/qadevOOo/runner/stats/SQLExecution.java b/qadevOOo/runner/stats/SQLExecution.java index b817ce25af9b..6fcab9ee84a0 100644 --- a/qadevOOo/runner/stats/SQLExecution.java +++ b/qadevOOo/runner/stats/SQLExecution.java @@ -24,7 +24,9 @@ import java.sql.ResultSetMetaData; import java.sql.Statement; import java.util.ArrayList; import java.util.Enumeration; +import java.util.HashMap; import java.util.Hashtable; +import java.util.Iterator; import java.util.StringTokenizer; /** @@ -120,10 +122,10 @@ public class SQLExecution { * Execute an sql command. * @param command The command to execute. * @param sqlInput Input values for the command. - * @param sqlOutput The results of the command are put in this Hashtable. + * @param sqlOutput The results of the command are put in this HashMap. * @return True, if no error occurred. */ - public boolean executeSQLCommand(String command, Hashtable sqlInput, Hashtable sqlOutput) + public boolean executeSQLCommand(String command, HashMap sqlInput, HashMap sqlOutput) throws IllegalArgumentException { return executeSQLCommand(command, sqlInput, sqlOutput, false); } @@ -132,15 +134,15 @@ public class SQLExecution { * Execute an sql command. * @param command The command to execute. * @param sqlInput Input values for the command. - * @param sqlOutput The results of the command are put in this Hashtable. + * @param sqlOutput The results of the command are put in this HashMap. * @param mergeOutputIntoInput The output of the result is put into the - * sqlInput Hashtable. + * sqlInput HashMap. * @return True, if no error occurred. */ - public boolean executeSQLCommand(String command, Hashtable sqlInput, Hashtable sqlOutput, boolean mergeOutputIntoInput) + public boolean executeSQLCommand(String command, HashMap sqlInput, HashMap sqlOutput, boolean mergeOutputIntoInput) throws IllegalArgumentException { if (sqlOutput == null) { - sqlOutput = new Hashtable(); + sqlOutput = new HashMap(); // this has to be true, so the user of this method gets a return mergeOutputIntoInput = true; if (sqlInput == null) { @@ -229,9 +231,9 @@ public class SQLExecution { execute((String)sqlCommand.get(i), sqlOutput, update); // merge output with input if (!update && mergeOutputIntoInput) { - Enumeration keys = sqlOutput.keys(); - while(keys.hasMoreElements()) { - String key = (String)keys.nextElement(); + Iterator keys = sqlOutput.keySet().iterator(); + while(keys.hasNext()) { + String key = (String)keys.next(); String[]val = (String[])sqlOutput.get(key); if (val != null && val.length != 0) { if (val.length == 1) @@ -252,9 +254,9 @@ public class SQLExecution { * @param command The command. * @param update If true, it is a update/alter command instead of an select * command - * @return A Hashtable with the result. + * @return A HashMap with the result. */ - private void execute(String command, Hashtable output, boolean update) { + private void execute(String command, HashMap output, boolean update) { if (m_bDebug) System.out.println("Debug - SQLExecution - execute Command: " + command); try { @@ -287,7 +289,7 @@ public class SQLExecution { if (goThroughRowsTheFirstTime) goThroughRowsTheFirstTime = false; - // put result in output Hashtable + // put result in output HashMap String[]s = new String[countRows]; s = (String[])v.toArray(s); output.put(columnNames[i-1], s); |