Oops.. almost broke type check via typecast!
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138947 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/LogFactory.java,v 1.17 2002/12/13 16:48:06 rsitze Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/LogFactory.java,v 1.18 2002/12/13 16:55:39 rsitze Exp $
|
||||||
* $Revision: 1.17 $
|
* $Revision: 1.18 $
|
||||||
* $Date: 2002/12/13 16:48:06 $
|
* $Date: 2002/12/13 16:55:39 $
|
||||||
*
|
*
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
@@ -87,7 +87,7 @@ import java.util.Properties;
|
|||||||
* @author Craig R. McClanahan
|
* @author Craig R. McClanahan
|
||||||
* @author Costin Manolache
|
* @author Costin Manolache
|
||||||
* @author Richard A. Sitze
|
* @author Richard A. Sitze
|
||||||
* @version $Revision: 1.17 $ $Date: 2002/12/13 16:48:06 $
|
* @version $Revision: 1.18 $ $Date: 2002/12/13 16:55:39 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public abstract class LogFactory {
|
public abstract class LogFactory {
|
||||||
@@ -544,7 +544,10 @@ public abstract class LogFactory {
|
|||||||
if (classLoader != null) {
|
if (classLoader != null) {
|
||||||
try {
|
try {
|
||||||
// first the given class loader param (thread class loader)
|
// first the given class loader param (thread class loader)
|
||||||
return classLoader.loadClass(factoryClass).newInstance();
|
|
||||||
|
// warning: must typecast here & allow exception
|
||||||
|
// to be generated/caught & recast propertly.
|
||||||
|
return (LogFactory)classLoader.loadClass(factoryClass).newInstance();
|
||||||
} catch (ClassNotFoundException ex) {
|
} catch (ClassNotFoundException ex) {
|
||||||
if (classLoader == LogFactory.class.getClassLoader()) {
|
if (classLoader == LogFactory.class.getClassLoader()) {
|
||||||
// Nothing more to try, onwards.
|
// Nothing more to try, onwards.
|
||||||
@@ -571,6 +574,8 @@ public abstract class LogFactory {
|
|||||||
* b) The Java endorsed library mechanism is instead
|
* b) The Java endorsed library mechanism is instead
|
||||||
* Class.forName(factoryClass);
|
* Class.forName(factoryClass);
|
||||||
*/
|
*/
|
||||||
|
// warning: must typecast here & allow exception
|
||||||
|
// to be generated/caught & recast propertly.
|
||||||
return (LogFactory)Class.forName(factoryClass).newInstance();
|
return (LogFactory)Class.forName(factoryClass).newInstance();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return new LogConfigurationException(e);
|
return new LogConfigurationException(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user