< prev index next >
src/java.naming/share/classes/javax/naming/spi/NamingManager.java
Print this page
*** 157,167 ****
clas = helper.loadClass(factoryName, codebase);
} catch (ClassNotFoundException e) {
}
}
! return (clas != null) ? (ObjectFactory) clas.newInstance() : null;
}
/**
* Creates an object using the factories specified in the
--- 157,169 ----
clas = helper.loadClass(factoryName, codebase);
} catch (ClassNotFoundException e) {
}
}
! @SuppressWarnings("deprecation") // Class.newInstance
! ObjectFactory result = (clas != null) ? (ObjectFactory) clas.newInstance() : null;
! return result;
}
/**
* Creates an object using the factories specified in the
*** 708,719 ****
throw ne;
}
if (factory == null) {
try {
! factory = (InitialContextFactory)
! helper.loadClass(className).newInstance();
} catch (Exception e) {
NoInitialContextException ne =
new NoInitialContextException(
"Cannot instantiate class: " + className);
ne.setRootCause(e);
--- 710,722 ----
throw ne;
}
if (factory == null) {
try {
! @SuppressWarnings("deprecation")
! Object o = helper.loadClass(className).newInstance();
! factory = (InitialContextFactory) o;
} catch (Exception e) {
NoInitialContextException ne =
new NoInitialContextException(
"Cannot instantiate class: " + className);
ne.setRootCause(e);
< prev index next >