< prev index next >

src/com/sun/javatest/FileParameters.java

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


 292 
 293     private void updateEnv() {
 294         TestEnvContext envTable = getEnvTable();
 295         if (envTable == null) {
 296             cachedEnv = null;
 297             envError = i18n.getString("fp.noEnvs", envName);
 298             return;
 299         }
 300 
 301         TestEnvironment env;
 302         try {
 303             if (envName == null)
 304                 envName = "";
 305             env = envTable.getEnv(envName);
 306             if (env == null) {
 307                 // note envName==null is always a valid environment
 308                 cachedEnv = null;
 309                 envError = i18n.getString("fp.envNotFound", envName);
 310                 return;
 311             }
 312             for (Iterator i = env.elements().iterator(); i.hasNext(); ) {
 313                 TestEnvironment.Element entry = (TestEnvironment.Element) (i.next());
 314                 if (entry.value.indexOf("VALUE_NOT_DEFINED") >= 0) {
 315                     String eText =
 316                         ( (entry.definedInEnv == null ? "" : "env." +  entry.definedInEnv + ".") +
 317                           entry.key + "=" + entry.value);
 318                     cachedEnv = null;
 319                     envError = i18n.getString("fp.undefinedEntry",
 320                                        new Object[] {eText, entry.definedInFile});
 321                     return;
 322                 }
 323             }
 324         }
 325         catch (TestEnvironment.Fault e) {
 326             cachedEnv = null;
 327             envError = i18n.getString("fp.badEnv", new Object[] {envName, e.getMessage()});
 328             return;
 329         }
 330         cachedEnv = env;
 331         envError = null;
 332     }
 333 




 292 
 293     private void updateEnv() {
 294         TestEnvContext envTable = getEnvTable();
 295         if (envTable == null) {
 296             cachedEnv = null;
 297             envError = i18n.getString("fp.noEnvs", envName);
 298             return;
 299         }
 300 
 301         TestEnvironment env;
 302         try {
 303             if (envName == null)
 304                 envName = "";
 305             env = envTable.getEnv(envName);
 306             if (env == null) {
 307                 // note envName==null is always a valid environment
 308                 cachedEnv = null;
 309                 envError = i18n.getString("fp.envNotFound", envName);
 310                 return;
 311             }
 312             for (Iterator<TestEnvironment.Element> i = env.elements().iterator(); i.hasNext(); ) {
 313                 TestEnvironment.Element entry = i.next();
 314                 if (entry.value.indexOf("VALUE_NOT_DEFINED") >= 0) {
 315                     String eText =
 316                         ( (entry.definedInEnv == null ? "" : "env." +  entry.definedInEnv + ".") +
 317                           entry.key + "=" + entry.value);
 318                     cachedEnv = null;
 319                     envError = i18n.getString("fp.undefinedEntry",
 320                                        new Object[] {eText, entry.definedInFile});
 321                     return;
 322                 }
 323             }
 324         }
 325         catch (TestEnvironment.Fault e) {
 326             cachedEnv = null;
 327             envError = i18n.getString("fp.badEnv", new Object[] {envName, e.getMessage()});
 328             return;
 329         }
 330         cachedEnv = env;
 331         envError = null;
 332     }
 333 


< prev index next >