[jbossws-commits] JBossWS SVN: r12642 - stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/client.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Jul 14 08:15:47 EDT 2010


Author: darran.lofthouse at jboss.com
Date: 2010-07-14 08:15:47 -0400 (Wed, 14 Jul 2010)
New Revision: 12642

Modified:
   stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java
Log:
[JBPAPP-4515] Corrected race condition regarding type of exception thrown from calls to get

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java	2010-07-14 12:12:17 UTC (rev 12641)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java	2010-07-14 12:15:47 UTC (rev 12642)
@@ -72,6 +72,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)
    {
@@ -97,7 +111,7 @@
    {
       if (result == null)
       {
-         getFuture().get();
+         getFutureInternal().get();
       }
       
       if (exception != null)
@@ -110,7 +124,7 @@
    {
       if (result == null)
       {
-         getFuture().get(timeout, unit);
+         getFutureInternal().get(timeout, unit);
       }
 
       if (exception != null)



More information about the jbossws-commits mailing list