Author: darran.lofthouse(a)jboss.com
Date: 2010-07-14 08:12:17 -0400 (Wed, 14 Jul 2010)
New Revision: 12641
Modified:
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java
Log:
[JBPAPP-4610] Corrected race condition regarding type of exception thrown from calls to
get
Modified:
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java 2010-07-14
12:09:20 UTC (rev 12640)
+++
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java 2010-07-14
12:12:17 UTC (rev 12641)
@@ -70,6 +70,20 @@
return delegate;
}
+
+ /*
+ * The get methods are required to throw any returned Exception as an
+ * ExecutionException so use this internal getFuture instead to avoid
+ * wrapping the exception with WebServiceException which is a
+ * RuntimeException.
+ */
+ private Future getFutureInternal()
+ {
+ if (delegate == null)
+ throw new IllegalStateException("Future not available");
+
+ return delegate;
+ }
public void setFuture(Future delegate)
{
@@ -95,7 +109,7 @@
{
if (result == null)
{
- getFuture().get();
+ getFutureInternal().get();
}
if (exception != null)
@@ -108,7 +122,7 @@
{
if (result == null)
{
- getFuture().get(timeout, unit);
+ getFutureInternal().get(timeout, unit);
}
if (exception != null)
Show replies by date