Catch NoClassDefFound Error when DiscoverClass not present, eliminating runtime dependency on [discovery], [logging]

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@141364 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Phil Steitz 2004-07-10 15:59:14 +00:00
parent d5a2cabb81
commit 78a6df915a
2 changed files with 6 additions and 6 deletions

View File

@ -41,7 +41,7 @@ import org.apache.commons.discovery.tools.DiscoverClass;
* <code>UnivariateRealSolverFactory.newInstance().</code> The default is
* {@link UnivariateRealSolverFactoryImpl}.
*
* @version $Revision: 1.15 $ $Date: 2004/06/23 16:26:14 $
* @version $Revision: 1.16 $ $Date: 2004/07/10 15:59:14 $
*/
public abstract class UnivariateRealSolverFactory {
/**
@ -61,8 +61,8 @@ public abstract class UnivariateRealSolverFactory {
factory = (UnivariateRealSolverFactory) dc.newInstance(
UnivariateRealSolverFactory.class,
"org.apache.commons.math.analysis.UnivariateRealSolverFactoryImpl");
} catch(Exception ex) {
// ignore as default implementation will be used.
} catch(Throwable t) {
return new UnivariateRealSolverFactoryImpl();
}
return factory;
}

View File

@ -39,7 +39,7 @@ import org.apache.commons.discovery.tools.DiscoverClass;
* ChiSquaredDistribution chi = factory.createChiSquareDistribution(5.0);
* </pre>
*
* @version $Revision: 1.20 $ $Date: 2004/06/23 16:26:15 $
* @version $Revision: 1.21 $ $Date: 2004/07/10 15:59:14 $
*/
public abstract class DistributionFactory {
/**
@ -60,8 +60,8 @@ public abstract class DistributionFactory {
factory = (DistributionFactory) dc.newInstance(
DistributionFactory.class,
"org.apache.commons.math.distribution.DistributionFactoryImpl");
} catch(Exception ex) {
// ignore as default implementation will be used.
} catch(Throwable t) {
return new DistributionFactoryImpl();
}
return factory;
}