You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by ks...@apache.org on 2012/01/23 16:01:18 UTC

svn commit: r1234835 - /juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java

Author: kstam
Date: Mon Jan 23 15:01:18 2012
New Revision: 1234835

URL: http://svn.apache.org/viewvc?rev=1234835&view=rev
Log:
JUDDI-537, Fixing NPE for methods that return void (null). Also the wrappers needed to handle cases where the Response and Request Wrapper annotations are used in the API. I special cased these cases in the RequestsHandler.

Modified:
    juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java

Modified: juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java
URL: http://svn.apache.org/viewvc/juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java?rev=1234835&r1=1234834&r2=1234835&view=diff
==============================================================================
--- juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java (original)
+++ juddi/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java Mon Jan 23 15:01:18 2012
@@ -719,10 +719,10 @@ public class RegistryV3Impl implements I
 
 		request.setMaxRows(maxRows);
 
-        BusinessList bl;
+        BusinessList bl = null;
         JAXBElement<?> o = execute(this.objectFactory.createFindBusiness(request),
         		this.getInquiryURI());
-        bl = (BusinessList) o.getValue();
+        if (o != null) bl = (BusinessList) o.getValue();
 
         return bl;
 	}
@@ -762,10 +762,10 @@ public class RegistryV3Impl implements I
 		}
 		request.setMaxRows(maxRows);
 
-        BindingDetail bd;
+        BindingDetail bd = null;
         JAXBElement<?> o = execute(this.objectFactory.createFindBinding(request), 
         		this.getInquiryURI());
-        bd = (BindingDetail) o.getValue();
+        if (o != null) bd = (BindingDetail) o.getValue();
 
         return bd;
 	}
@@ -806,10 +806,10 @@ public class RegistryV3Impl implements I
 
 		request.setMaxRows(maxRows);
 
-        ServiceList sl;
+        ServiceList sl = null;
         JAXBElement<?> o = execute(this.objectFactory.createFindService(request), 
         		this.getInquiryURI());
-        sl = (ServiceList) o.getValue();
+        if (o != null) sl = (ServiceList) o.getValue();
 
         return sl;
 	}
@@ -847,10 +847,10 @@ public class RegistryV3Impl implements I
 
 		request.setMaxRows(maxRows);
 
-        TModelList tml;
+        TModelList tml = null;
         JAXBElement<?> o = execute(this.objectFactory.createFindTModel(request), 
         		this.getInquiryURI());
-        tml = (TModelList) o.getValue();
+        if (o !=null) tml = (TModelList) o.getValue();
 
         return tml;
 	}
@@ -871,7 +871,7 @@ public class RegistryV3Impl implements I
 			request.setCompletionStatus(cs);
 		}
 
-        AssertionStatusReport asr;
+        AssertionStatusReport asr = new AssertionStatusReport();
         JAXBElement<?> o = execute(this.objectFactory.createGetAssertionStatusReport(request), 
         		this.getPublishURI());
         asr = (AssertionStatusReport) o.getValue();
@@ -943,7 +943,7 @@ public class RegistryV3Impl implements I
 			request.getBusinessKey().addAll(Arrays.asList(businessKeyArray));
 		}
 
-        BusinessDetail bd;
+        BusinessDetail bd = null;
         JAXBElement<?> o = execute(this.objectFactory.createGetBusinessDetail(request), 
         		this.getInquiryURI());
         bd = (BusinessDetail) o.getValue(); 
@@ -964,10 +964,12 @@ public class RegistryV3Impl implements I
         PublisherAssertions pa = new PublisherAssertions();
         JAXBElement<?> o = execute(this.objectFactory.createGetPublisherAssertions(request),
         		this.getPublishURI());
-        PublisherAssertionsResponse par = (PublisherAssertionsResponse) o.getValue();
-        List<PublisherAssertion> assertions = par.getPublisherAssertion();
-        for (int i = 0; i < assertions.size(); i++ ) {
-        	pa.getPublisherAssertion().add((PublisherAssertion)assertions.get(i));
+        if (o != null) {
+            PublisherAssertionsResponse par = (PublisherAssertionsResponse) o.getValue();
+            List<PublisherAssertion> assertions = par.getPublisherAssertion();
+            for (int i = 0; i < assertions.size(); i++ ) {
+            	pa.getPublisherAssertion().add((PublisherAssertion)assertions.get(i));
+            }
         }
 
         return pa;
@@ -986,10 +988,10 @@ public class RegistryV3Impl implements I
 		
 		request.setInfoSelection(InfoSelection.ALL);
 
-        RegisteredInfo ri;
+        RegisteredInfo ri = null;
         JAXBElement<?> o = execute(this.objectFactory.createGetRegisteredInfo(request), 
         		this.getPublishURI());
-        ri = (RegisteredInfo) o.getValue();
+        if (o != null) ri = (RegisteredInfo) o.getValue();
 
         return ri;
 	}
@@ -1022,10 +1024,10 @@ public class RegistryV3Impl implements I
 			request.getServiceKey().addAll(Arrays.asList(serviceKeyArray));
 		}
 
-        ServiceDetail sd;
+        ServiceDetail sd = null;
         JAXBElement<?> o = execute(this.objectFactory.createGetServiceDetail(request), 
         		this.getInquiryURI());
-        sd = (ServiceDetail) o.getValue();
+        if (o != null) sd = (ServiceDetail) o.getValue();
 
         return sd;
 	}
@@ -1058,10 +1060,10 @@ public class RegistryV3Impl implements I
 			request.getTModelKey().addAll(Arrays.asList(tModelKeyArray));
 		}
 
-        TModelDetail tmd;
+        TModelDetail tmd = null;
         JAXBElement<?> o = execute(this.objectFactory.createGetTModelDetail(request), 
         		this.getInquiryURI());
-        tmd = (TModelDetail) o.getValue();
+        if (o != null) tmd = (TModelDetail) o.getValue();
 
         return tmd;
 	}
@@ -1108,10 +1110,10 @@ public class RegistryV3Impl implements I
 			request.getBindingTemplate().addAll(Arrays.asList(bindingArray));
 		}
 		
-        BindingDetail bd;
+        BindingDetail bd = null;
         JAXBElement<?> o = execute(this.objectFactory.createSaveBinding(request), 
         		this.getPublishURI());
-        bd = (BindingDetail) o.getValue();
+        if (o != null) bd = (BindingDetail) o.getValue();
 
         return bd;
 	}
@@ -1143,10 +1145,10 @@ public class RegistryV3Impl implements I
 			request.getBusinessEntity().addAll(Arrays.asList(businessArray));
 		}
 		
-        BusinessDetail bd;
+        BusinessDetail bd = null;
         JAXBElement<?> o = execute(this.objectFactory.createSaveBusiness(request), 
         		this.getPublishURI());
-        bd = (BusinessDetail) o.getValue();
+        if (o != null) bd = (BusinessDetail) o.getValue();
 
         return bd;
 	}
@@ -1169,10 +1171,10 @@ public class RegistryV3Impl implements I
 			request.getBusinessService().addAll(Arrays.asList(serviceArray));
 		}
 
-        ServiceDetail sd;
+        ServiceDetail sd = null;
         JAXBElement<?> o = execute(this.objectFactory.createSaveService(request), 
         		this.getPublishURI());
-        sd = (ServiceDetail) o.getValue();
+        if (o != null) sd = (ServiceDetail) o.getValue();
 
         return sd;
 	}
@@ -1194,10 +1196,10 @@ public class RegistryV3Impl implements I
 			request.getTModel().addAll(Arrays.asList(tModelArray));
 		}
 
-        TModelDetail tmd;
+        TModelDetail tmd = null;
         JAXBElement<?> o = execute(this.objectFactory.createSaveTModel(request), 
         		this.getPublishURI());
-        tmd = (TModelDetail) o.getValue();
+        if (o != null) tmd = (TModelDetail) o.getValue();
         return tmd;
 	}
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org