< prev index next >
src/com/sun/javatest/TestEnvironment.java
Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg
*** 115,125 ****
defaultPropTableNames = new String[0];
defaultPropTables = new Map[0];
}
static String[] defaultPropTableNames = { };
! static Map[] defaultPropTables = { };
/**
* Construct an environment for a named group of properties.
* @param name The name by which to identify the group of properties
* for this environment
--- 115,125 ----
defaultPropTableNames = new String[0];
defaultPropTables = new Map[0];
}
static String[] defaultPropTableNames = { };
! static Map<String, String>[] defaultPropTables = new Map[0];
/**
* Construct an environment for a named group of properties.
* @param name The name by which to identify the group of properties
* for this environment
*** 128,138 ****
* @param propTableName
* The name of the property table, for use in diagnostics etc
* @throws TestEnvironment.Fault if there is an error in the table
*
*/
! public TestEnvironment(String name, Map propTable, String propTableName)
throws Fault {
this(name, (new Map[] {propTable}), (new String[] {propTableName}));
}
/**
--- 128,138 ----
* @param propTableName
* The name of the property table, for use in diagnostics etc
* @throws TestEnvironment.Fault if there is an error in the table
*
*/
! public TestEnvironment(String name, Map<String, String> propTable, String propTableName)
throws Fault {
this(name, (new Map[] {propTable}), (new String[] {propTableName}));
}
/**
*** 176,193 ****
// properties of the form env.NAME.KEY=value and add KEY=value into the
// environment's table
for (int inheritIndex = 0; inheritIndex < inherits.length; inheritIndex++) {
String prefix = "env." + inherits[inheritIndex] + ".";
for (int propIndex = propTables.length - 1; propIndex >= 0; propIndex--) {
! Map propTable = propTables[propIndex];
! for (Iterator i = propTable.keySet().iterator(); i.hasNext(); ) {
! String prop = (String) (i.next());
if (prop.startsWith(prefix)) {
String key = prop.substring(prefix.length());
if (!table.containsKey(key)) {
Element elem = new Element(key,
! (String)(propTable.get(prop)),
inherits[inheritIndex],
propTableNames[propIndex]);
table.put(key, elem);
}
}
--- 176,193 ----
// properties of the form env.NAME.KEY=value and add KEY=value into the
// environment's table
for (int inheritIndex = 0; inheritIndex < inherits.length; inheritIndex++) {
String prefix = "env." + inherits[inheritIndex] + ".";
for (int propIndex = propTables.length - 1; propIndex >= 0; propIndex--) {
! Map<String, String> propTable = propTables[propIndex];
! for (Iterator<String> i = propTable.keySet().iterator(); i.hasNext(); ) {
! String prop = (i.next());
if (prop.startsWith(prefix)) {
String key = prop.substring(prefix.length());
if (!table.containsKey(key)) {
Element elem = new Element(key,
! (propTable.get(prop)),
inherits[inheritIndex],
propTableNames[propIndex]);
table.put(key, elem);
}
}
*** 195,211 ****
}
}
// finally, add in any top-level names (not beginning with env.)
for (int propIndex = propTables.length - 1; propIndex >= 0; propIndex--) {
! Map propTable = propTables[propIndex];
! for (Iterator i = propTable.keySet().iterator(); i.hasNext(); ) {
! String key = (String) (i.next());
if (!key.startsWith("env.")) {
if (!table.containsKey(key)) {
Element elem = new Element(key,
! (String)(propTable.get(key)),
null,
propTableNames[propIndex]);
table.put(key, elem);
}
}
--- 195,211 ----
}
}
// finally, add in any top-level names (not beginning with env.)
for (int propIndex = propTables.length - 1; propIndex >= 0; propIndex--) {
! Map<String, String> propTable = propTables[propIndex];
! for (Iterator<String> i = propTable.keySet().iterator(); i.hasNext(); ) {
! String key = (i.next());
if (!key.startsWith("env.")) {
if (!table.containsKey(key)) {
Element elem = new Element(key,
! (propTable.get(key)),
null,
propTableNames[propIndex]);
table.put(key, elem);
}
}
*** 556,567 ****
* the text VALUE_NOT_DEFINED.
* @return true if and only if there are any entries containing the text
* VALUE_NOT_DEFINED.
*/
public boolean hasUndefinedValues() {
! for (Iterator i = elements().iterator(); i.hasNext(); ) {
! TestEnvironment.Element entry = (TestEnvironment.Element) (i.next());
if (entry.value.indexOf("VALUE_NOT_DEFINED") >= 0)
return true;
}
return false;
}
--- 556,567 ----
* the text VALUE_NOT_DEFINED.
* @return true if and only if there are any entries containing the text
* VALUE_NOT_DEFINED.
*/
public boolean hasUndefinedValues() {
! for (Iterator<Element> i = elements().iterator(); i.hasNext(); ) {
! Element entry = i.next();
if (entry.value.indexOf("VALUE_NOT_DEFINED") >= 0)
return true;
}
return false;
}
*** 623,633 ****
* @return An enumeration that yields the various keys, explicit or inherited,
* that are available in this environment. The keys do <em>not</em>
* include the `env.<em>environment-name</em>.' prefix of the corresponding
* property names.
*/
! public Set keys() {
return table.keySet();
}
/**
* Get a collection containing those entries in this environment that have been
--- 623,633 ----
* @return An enumeration that yields the various keys, explicit or inherited,
* that are available in this environment. The keys do <em>not</em>
* include the `env.<em>environment-name</em>.' prefix of the corresponding
* property names.
*/
! public Set<String> keys() {
return table.keySet();
}
/**
* Get a collection containing those entries in this environment that have been
*** 635,645 ****
* other entries.
* @return a collection of those entries in this environment that have been
* referenced.
* @see #resetElementsUsed
*/
! public Collection elementsUsed() {
return cache.values();
}
/**
* Reset the record of entries in this environment that have been referenced.
--- 635,645 ----
* other entries.
* @return a collection of those entries in this environment that have been
* referenced.
* @see #resetElementsUsed
*/
! public Collection<Element> elementsUsed() {
return cache.values();
}
/**
* Reset the record of entries in this environment that have been referenced.
*** 653,663 ****
* Enumerate the elements for this environment, including any inherited elements.
*
* @return An enumeration that yields the various elements, explicit or inherited,
* that are available in this environment.
*/
! public Collection elements() {
return table.values();
}
protected TestEnvironment(TestEnvironment o) {
--- 653,663 ----
* Enumerate the elements for this environment, including any inherited elements.
*
* @return An enumeration that yields the various elements, explicit or inherited,
* that are available in this environment.
*/
! public Collection<Element> elements() {
return table.values();
}
protected TestEnvironment(TestEnvironment o) {
< prev index next >