ws-scout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r190394 - /webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java
Date Mon, 13 Jun 2005 13:04:00 GMT
Author: geirm
Date: Mon Jun 13 06:04:00 2005
New Revision: 190394

URL: http://svn.apache.org/viewcvs?rev=190394&view=rev
Log:
small tweaks to keep the NPEs to the usual level.

We aren't ever assured that we'll have a descrption.  I'm going to dig deeper and make sure
that we always
at least get a vector back, even if empty.


Modified:
    webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java
URL: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java?rev=190394&r1=190393&r2=190394&view=diff
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java
(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java
Mon Jun 13 06:04:00 2005
@@ -71,7 +71,15 @@
       Name n = (Name)namevect.elementAt(0);
       String name = n.getValue();
       Vector descvect = entity.getDescriptionVector();
-      Description desc = (Description)descvect.elementAt(0);
+
+       Description desc = null;
+
+       if (descvect != null && descvect.size() > 0) {
+           desc = (Description)descvect.elementAt(0);
+       }
+       else {
+           desc = new Description("");
+       }
 
       Organization org = new OrganizationImpl(lcm);
       org.setName(getIString(name, lcm));
@@ -163,7 +171,15 @@
       Name n = (Name)namevect.elementAt(0);
       String name = n.getValue();
       Vector descvect = entity.getDescriptionVector();
-      Description desc = (Description)descvect.elementAt(0);
+
+        Description desc = null;
+
+        if (descvect != null && descvect.size() > 0) {
+            desc = (Description)descvect.elementAt(0);
+        }
+        else {
+            desc = new Description("");
+        }
 
       Organization org = new OrganizationImpl(lcm);
       org.setName(getIString(name, lcm));
@@ -265,7 +281,16 @@
       String name = n.getValue();
       serve.setName(lcm.createInternationalString(name));
       Vector descvect = bs.getDescriptionVector();
-      Description desc = (Description)descvect.elementAt(0);
+
+       Description desc = null;
+
+       if (descvect != null && descvect.size() > 0) {
+           desc = (Description)descvect.elementAt(0);
+       }
+       else {
+           desc = new Description("");
+       }
+
       serve.setDescription(lcm.createInternationalString(desc.getValue()));
       return serve;
    }
@@ -335,7 +360,16 @@
       concept.setName(lcm.createInternationalString(tmodel.getName()));
 
       Vector descvect = tmodel.getDescriptionVector();
-      Description desc = (Description)descvect.elementAt(0);
+
+       Description desc = null;
+
+       if (descvect != null && descvect.size() > 0) {
+           desc = (Description) descvect.elementAt(0);
+       }
+       else {
+           desc = new Description("");
+       }
+
       concept.setDescription(lcm.createInternationalString(desc.getValue()));
 
       return concept;
@@ -349,7 +383,16 @@
       concept.setName(lcm.createInternationalString(tmodel.getName()));
 
       Vector descvect = tmodel.getDescriptionVector();
-      Description desc = (Description)descvect.elementAt(0);
+
+       Description desc = null;
+
+       if (descvect != null && descvect.size() > 0) {
+           desc = (Description) descvect.elementAt(0);
+       }
+       else {
+           desc = new Description("");
+       }
+
       concept.setDescription(lcm.createInternationalString(desc.getValue()));
 
       return concept;



---------------------------------------------------------------------
To unsubscribe, e-mail: scout-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: scout-dev-help@ws.apache.org


Mime
View raw message