Author: struberg
Date: Tue Mar 15 09:29:39 2011
New Revision: 1081693
URL: http://svn.apache.org/viewvc?rev=1081693&view=rev
Log:
OWB-461 move getRootCause to OwbBean
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java?rev=1081693&r1=1081692&r2=1081693&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
Tue Mar 15 09:29:39 2011
@@ -38,7 +38,6 @@ import org.apache.webbeans.container.Bea
import org.apache.webbeans.context.creational.CreationalContextImpl;
import org.apache.webbeans.exception.WebBeansConfigurationException;
import org.apache.webbeans.logger.WebBeansLogger;
-import org.apache.webbeans.util.ClassUtil;
/**
* Abstract implementation of the {@link OwbBean} contract.
@@ -186,7 +185,7 @@ public abstract class AbstractOwbBean<T>
}
catch (Exception re)
{
- Throwable throwable = ClassUtil.getRootException(re);
+ Throwable throwable = getRootException(re);
if(!(throwable instanceof RuntimeException))
{
@@ -198,6 +197,18 @@ public abstract class AbstractOwbBean<T>
return instance;
}
+ private Throwable getRootException(Throwable throwable)
+ {
+ if(throwable.getCause() == null || throwable.getCause() == throwable)
+ {
+ return throwable;
+ }
+ else
+ {
+ return getRootException(throwable.getCause());
+ }
+ }
+
/**
* Creates the instance of the bean that has a specific implementation
* type. Each subclass must define its own create mechanism.
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java?rev=1081693&r1=1081692&r2=1081693&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
Tue Mar 15 09:29:39 2011
@@ -1780,18 +1780,7 @@ public final class ClassUtil
}
- public static Throwable getRootException(Throwable throwable)
- {
- if(throwable.getCause() == null)
- {
- return throwable;
- }
- else
- {
- return getRootException(throwable.getCause());
- }
- }
-
+
/**
* Returns injection point raw type.
*