Author: boisvert
Date: Mon Oct 16 15:03:30 2006
New Revision: 464690

URL: http://svn.apache.org/viewvc?view=rev&rev=464690
Log:
Prevent possible NPE during definition lookup if nothing is defined in a given 
namespace

Modified:
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java

Modified: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java?view=diff&rev=464690&r1=464689&r2=464690
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java
 (original)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java
 Mon Oct 16 15:03:30 2006
@@ -234,6 +234,7 @@
 
     public Property getProperty(QName name) {
         ArrayList<Definition4BPEL> defs = 
_definitions.get(name.getNamespaceURI());
+        if (defs == null) return null;
         for (Definition4BPEL definition4BPEL : defs) {
             if (definition4BPEL != null && definition4BPEL.getProperty(name) 
!= null)
                 return definition4BPEL.getProperty(name);
@@ -243,6 +244,7 @@
 
     public PropertyAlias getPropertyAlias(QName propertyName, QName 
messageType) {
         ArrayList<Definition4BPEL> defs = 
_definitions.get(propertyName.getNamespaceURI());
+        if (defs == null) return null;
         for (Definition4BPEL definition4BPEL : defs) {
             if (definition4BPEL != null && 
definition4BPEL.getPropertyAlias(propertyName, messageType) != null)
                 return definition4BPEL.getPropertyAlias(propertyName, 
messageType);
@@ -252,6 +254,7 @@
 
     public PartnerLinkType getPartnerLinkType(QName partnerLinkType) {
         ArrayList<Definition4BPEL> defs = 
_definitions.get(partnerLinkType.getNamespaceURI());
+        if (defs == null) return null;
         for (Definition4BPEL definition4BPEL : defs) {
             if (definition4BPEL != null && 
definition4BPEL.getPartnerLinkType(partnerLinkType) != null)
                 return definition4BPEL.getPartnerLinkType(partnerLinkType);
@@ -261,6 +264,7 @@
 
     public PortType getPortType(QName portType) {
         ArrayList<Definition4BPEL> defs = 
_definitions.get(portType.getNamespaceURI());
+        if (defs == null) return null;
         for (Definition4BPEL definition4BPEL : defs) {
             if (definition4BPEL != null && 
definition4BPEL.getPortType(portType) != null)
                 return definition4BPEL.getPortType(portType);
@@ -270,6 +274,7 @@
 
     public Message getMessage(QName msgType) {
         ArrayList<Definition4BPEL> defs = 
_definitions.get(msgType.getNamespaceURI());
+        if (defs == null) return null;
         for (Definition4BPEL definition4BPEL : defs) {
             if (definition4BPEL != null && definition4BPEL.getMessage(msgType) 
!= null)
                 return definition4BPEL.getMessage(msgType);


Reply via email to