< prev index next >

src/com/sun/javatest/TestEnvContext.java

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

*** 91,101 **** * @param tables An array of tables giving the properties to be read * @param tableNames An array of names, one for each table in the tables array, * that will be used to identify the source of the properties in any * environments that are created */ ! public TestEnvContext(Map[] tables, String[] tableNames) { Vector<String> n = new Vector<>(); Vector<Map<String, String>> p = new Vector<>(); for (int i = 0; i < tables.length; i++) { add(p, n, tables[i], tableNames[i]); } --- 91,101 ---- * @param tables An array of tables giving the properties to be read * @param tableNames An array of names, one for each table in the tables array, * that will be used to identify the source of the properties in any * environments that are created */ ! public TestEnvContext(Map<String, String>[] tables, String[] tableNames) { Vector<String> n = new Vector<>(); Vector<Map<String, String>> p = new Vector<>(); for (int i = 0; i < tables.length; i++) { add(p, n, tables[i], tableNames[i]); }
*** 110,120 **** * Create a context from a named table. * @param table A table giving the properties to be read * @param tableName The name that will be used to identify the source * of the properties in any environments that are created. */ ! public TestEnvContext(Map table, String tableName) { Vector<String> n = new Vector<>(); Vector<Map<String, String>> p = new Vector<>(); add(p, n, table, tableName); propTables = new Map[p.size()]; p.copyInto(propTables); --- 110,120 ---- * Create a context from a named table. * @param table A table giving the properties to be read * @param tableName The name that will be used to identify the source * of the properties in any environments that are created. */ ! public TestEnvContext(Map<String, String> table, String tableName) { Vector<String> n = new Vector<>(); Vector<Map<String, String>> p = new Vector<>(); add(p, n, table, tableName); propTables = new Map[p.size()]; p.copyInto(propTables);
*** 233,247 **** } } private void updateEnvTable() { // the tables given to the constructor ... ! Map[] tables = propTables; String[] tableNames = propTableNames; // defaults given to TestEnvironment ! Map[] defaultTables = TestEnvironment.defaultPropTables; String[] defaultTableNames = TestEnvironment.defaultPropTableNames; // if there are defaults, merge them with the TestEnvContext tables // for the purposes of determining the EnvTable if (defaultTables != null && defaultTables.length > 0) { --- 233,247 ---- } } private void updateEnvTable() { // the tables given to the constructor ... ! Map<String, String>[] tables = propTables; String[] tableNames = propTableNames; // defaults given to TestEnvironment ! Map<String, String>[] defaultTables = TestEnvironment.defaultPropTables; String[] defaultTableNames = TestEnvironment.defaultPropTableNames; // if there are defaults, merge them with the TestEnvContext tables // for the purposes of determining the EnvTable if (defaultTables != null && defaultTables.length > 0) {
*** 267,279 **** for (int i = 0; i < tables.length; i++) { if (debug) System.err.println("Checking " + tableNames[i] + " for environments..."); ! Map table = tables[i]; ! for (Iterator ii = table.keySet().iterator(); ii.hasNext(); ) { ! String prop = (String) (ii.next()); String name = null; if (debug) System.err.println("Checking property " + prop); --- 267,279 ---- for (int i = 0; i < tables.length; i++) { if (debug) System.err.println("Checking " + tableNames[i] + " for environments..."); ! Map<String, String> table = tables[i]; ! for (Iterator<String> ii = table.keySet().iterator(); ii.hasNext(); ) { ! String prop = (ii.next()); String name = null; if (debug) System.err.println("Checking property " + prop);
*** 283,293 **** if (prop.endsWith(DOT_INHERITS)) { name = prop.substring(ENV_DOT.length(), prop.length() - DOT_INHERITS.length()); } else if (prop.endsWith(DOT_MENU)) { name = prop.substring(ENV_DOT.length(), prop.length() - DOT_MENU.length()); ! String value = (String) (table.get(prop)); if ("false".equals(value)) sortedInsert(menuExcludeVec, name); } else if (prop.endsWith(DOT_DESCRIPTION)) { name = prop.substring(ENV_DOT.length(), prop.length() - DOT_DESCRIPTION.length()); --- 283,293 ---- if (prop.endsWith(DOT_INHERITS)) { name = prop.substring(ENV_DOT.length(), prop.length() - DOT_INHERITS.length()); } else if (prop.endsWith(DOT_MENU)) { name = prop.substring(ENV_DOT.length(), prop.length() - DOT_MENU.length()); ! String value = (table.get(prop)); if ("false".equals(value)) sortedInsert(menuExcludeVec, name); } else if (prop.endsWith(DOT_DESCRIPTION)) { name = prop.substring(ENV_DOT.length(), prop.length() - DOT_DESCRIPTION.length());
*** 339,349 **** return; } v.addElement(s); } ! private Map[] propTables; private String[] propTableNames; private String[] envNames; private String[] envMenuNames; private static I18NResourceBundle i18n = I18NResourceBundle.getBundleForClass(TestEnvContext.class); --- 339,349 ---- return; } v.addElement(s); } ! private Map<String, String>[] propTables; private String[] propTableNames; private String[] envNames; private String[] envMenuNames; private static I18NResourceBundle i18n = I18NResourceBundle.getBundleForClass(TestEnvContext.class);
< prev index next >