You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/04/12 06:21:04 UTC

svn commit: r527764 - in /incubator/tuscany/java/sca/modules: ./ assembly/src/main/java/org/apache/tuscany/assembly/impl/ host-embedded/src/main/java/org/apache/tuscany/host/embedded/ host-embedded/src/main/java/org/osoa/ host-embedded/src/main/java/or...

Author: jsdelfino
Date: Wed Apr 11 21:20:58 2007
New Revision: 527764

URL: http://svn.apache.org/viewvc?view=rev&rev=527764
Log:
Handle nulls in equals methods. Temporarily added deprecated CompositeContext to embedded host to help bring up samples and integration tests that still use this deprecated API.

Added:
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleCompositeContextImpl.java   (with props)
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CompositeContext.java   (with props)
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CurrentCompositeContext.java   (with props)
Modified:
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/impl/CompositeImpl.java
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/impl/ConstrainingTypeImpl.java
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleRuntimeImpl.java
    incubator/tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/implementation/java/impl/JavaImplementationImpl.java
    incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/interfacedef/java/impl/JavaInterfaceImpl.java
    incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLDefinitionImpl.java
    incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
    incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/XSDefinitionImpl.java
    incubator/tuscany/java/sca/modules/pom.xml

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/impl/CompositeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/impl/CompositeImpl.java?view=diff&rev=527764&r1=527763&r2=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/impl/CompositeImpl.java (original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/impl/CompositeImpl.java Wed Apr 11 21:20:58 2007
@@ -25,9 +25,11 @@
 import javax.xml.namespace.QName;
 
 import org.apache.tuscany.assembly.Component;
+import org.apache.tuscany.assembly.ComponentType;
 import org.apache.tuscany.assembly.Composite;
 import org.apache.tuscany.assembly.CompositeReference;
 import org.apache.tuscany.assembly.CompositeService;
+import org.apache.tuscany.assembly.ConstrainingType;
 import org.apache.tuscany.assembly.Property;
 import org.apache.tuscany.assembly.Reference;
 import org.apache.tuscany.assembly.Service;
@@ -138,11 +140,16 @@
     
     @Override
     public boolean equals(Object obj) {
-        if (obj == this)
+        if (obj == this) {
             return true;
-        else if (obj instanceof Composite && getName().equals(((Composite)obj).getName()))
-             return true;
-        else
+        } else if (obj instanceof Composite) {
+            if (getName() != null) {
+                return getName().equals(((Composite)obj).getName());
+            } else {
+                return ((Composite)obj).getName() == null;
+            }
+        } else {
             return false;
+        }
     }
 }

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/impl/ConstrainingTypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/impl/ConstrainingTypeImpl.java?view=diff&rev=527764&r1=527763&r2=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/impl/ConstrainingTypeImpl.java (original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/impl/ConstrainingTypeImpl.java Wed Apr 11 21:20:58 2007
@@ -95,11 +95,16 @@
     
     @Override
     public boolean equals(Object obj) {
-        if (obj == this)
+        if (obj == this) {
             return true;
-        else if (obj instanceof ConstrainingType && getName().equals(((ConstrainingType)obj).getName()))
-             return true;
-        else
+        } else if (obj instanceof ConstrainingType) {
+            if (getName() != null) {
+                return getName().equals(((ConstrainingType)obj).getName());
+            } else {
+                return ((ConstrainingType)obj).getName() == null;
+            }
+        } else {
             return false;
+        }
     }
 }

Added: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleCompositeContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleCompositeContextImpl.java?view=auto&rev=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleCompositeContextImpl.java (added)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleCompositeContextImpl.java Wed Apr 11 21:20:58 2007
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.host.embedded;
+
+import java.net.URI;
+
+import org.apache.tuscany.assembly.Component;
+import org.apache.tuscany.assembly.ComponentService;
+import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.CompositeService;
+import org.apache.tuscany.assembly.SCABinding;
+import org.apache.tuscany.assembly.Service;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.ServiceRuntimeException;
+
+/**
+ * Temporary here to help the bring up of samples and integration tests that
+ * still use the 0.95 CompositeContext interface.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SimpleCompositeContextImpl implements CompositeContext {
+    
+    private SimpleRuntime runtime;
+    private Composite composite;
+    
+    public SimpleCompositeContextImpl(SimpleRuntime runtime, Composite composite) {
+        this.runtime = runtime;
+        this.composite = composite;
+    }
+
+    public ServiceReference createServiceReferenceForSession(Object self) {
+        throw new UnsupportedOperationException();
+    }
+
+    public ServiceReference createServiceReferenceForSession(Object self, String serviceName) {
+        throw new UnsupportedOperationException();
+    }
+
+    public String getName() {
+        if (composite.getName() != null) { 
+            return composite.getName().getLocalPart();
+        } else {
+            return null;
+        }
+    }
+
+    public RequestContext getRequestContext() {
+        throw new UnsupportedOperationException();
+    }
+
+    public String getURI() {
+        throw new UnsupportedOperationException();
+    }
+
+    public <T> T locateService(Class<T> serviceType, String serviceName) {
+        String componentName;
+        int i = serviceName.indexOf('/');
+        if (i == -1) {
+            for (Service service: composite.getServices()) {
+                CompositeService compositeService = (CompositeService)service;
+                if (serviceName.equals(compositeService.getName())) {
+                    ComponentService componentService = compositeService.getPromotedService();
+                    if (componentService != null) {
+                        SCABinding binding = componentService.getBinding(SCABinding.class);
+                        if (binding != null) {
+                            Component component = binding.getComponent();
+                            if (component != null) {
+                                ComponentContext context = runtime.getComponentContext(URI.create(component.getName()));
+                                if (context == null) {
+                                    throw new ServiceRuntimeException("Service not found: " + serviceName);
+                                }
+                                ServiceReference<T> serviceReference = context.createSelfReference(serviceType);
+                                return serviceReference.getService();
+                            }
+                        }
+                    }
+                    break;
+                }
+            }
+            throw new ServiceRuntimeException("Service not found: " + serviceName);
+            
+        } else {
+            componentName = serviceName.substring(0, i);
+            serviceName = serviceName.substring(i + 1);
+            ComponentContext context = runtime.getComponentContext(URI.create(componentName));
+            if (context == null) {
+                throw new ServiceRuntimeException("Component not found: " + componentName);
+            }
+            ServiceReference<T> serviceReference = context.createSelfReference(serviceType);
+            return serviceReference.getService();
+        }
+    }
+
+    public ServiceReference newSession(String serviceName) {
+        throw new UnsupportedOperationException();
+    }
+
+    public ServiceReference newSession(String serviceName, Object sessionId) {
+        throw new UnsupportedOperationException();
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleCompositeContextImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleCompositeContextImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleRuntimeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleRuntimeImpl.java?view=diff&rev=527764&r1=527763&r2=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleRuntimeImpl.java (original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/SimpleRuntimeImpl.java Wed Apr 11 21:20:58 2007
@@ -66,6 +66,8 @@
 import org.apache.tuscany.spi.component.ScopeRegistry;
 import org.apache.tuscany.spi.component.TargetResolutionException;
 import org.apache.tuscany.spi.component.WorkContext;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
 
 /**
  * @version $Rev$ $Date$
@@ -167,6 +169,12 @@
         workContext.setIdentifier(Scope.COMPOSITE, DEFAULT_COMPOSITE);
         PojoWorkContextTunnel.setThreadWorkContext(workContext);
         tuscanySystem = getComponentManager().getComponent(URI.create("/" + composite.getName().getLocalPart()));
+        
+        // Temporary here to help the bring up of samples and integration tests that still
+        // use the 0.95 API
+        CompositeContext context = new SimpleCompositeContextImpl(this, composite);
+        CurrentCompositeContext.setContext(context);
+        
         return tuscanySystem;
     }
 

Added: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CompositeContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CompositeContext.java?view=auto&rev=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CompositeContext.java (added)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CompositeContext.java Wed Apr 11 21:20:58 2007
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.osoa.sca;
+
+
+/**
+ * @deprecated
+ * 
+ * Temporary here to help the bring up of samples and integration tests that
+ * still use the 0.95 CompositeContext interface.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface CompositeContext {
+
+    /**
+     * Returns the name of the parent composite.
+     *
+     * @return the name of the module
+     */
+    String getName();
+
+    /**
+     * Returns the absolute URI of the composite component.
+     *
+     * @return the absolute URI of the module component
+     */
+    String getURI();
+
+    /**
+     * Returns the request context that corresponds to the last remotable service invocation. If this is
+     * invoked from outside an SCA component then <tt>null</tt> is returned.
+     *
+     * @return the current request context
+     */
+    RequestContext getRequestContext();
+
+    /**
+     * Returns an object implementing the interface defined for the named service.
+     *
+     * @param serviceName the name of another service in the current module
+     * @return an object that implements the service's interface
+     */
+    <T> T locateService(Class<T> serviceType, String serviceName);
+
+    /**
+     * Create a reference to the supplied component. The component must define only one service.
+     *
+     * @param self the component to be referenced
+     * @return a reference to the component
+     */
+    ServiceReference createServiceReferenceForSession(Object self);
+
+    /**
+     * Create a reference to the named service implemented by the supplied component.
+     *
+     * @param self        the component to be referenced
+     * @param serviceName the service to be referenced
+     * @return a reference to the service
+     */
+    ServiceReference createServiceReferenceForSession(Object self, String serviceName);
+
+    /**
+     * Create a new session for stateful interaction with the named service.
+     *
+     * @param serviceName the name of the service to interact with
+     * @return a reference to the service
+     */
+    ServiceReference newSession(String serviceName);
+
+    /**
+     * Create a new session for stateful interaction with the named service using an application-supplied
+     * session identifier.
+     *
+     * @param serviceName the name of the service to interact with
+     * @param sessionId   a token that identifies this session
+     * @return a reference to the service
+     */
+    ServiceReference newSession(String serviceName, Object sessionId);
+}

Propchange: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CompositeContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CompositeContext.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CurrentCompositeContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CurrentCompositeContext.java?view=auto&rev=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CurrentCompositeContext.java (added)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CurrentCompositeContext.java Wed Apr 11 21:20:58 2007
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.osoa.sca;
+
+/**
+ * @deprecated
+ * 
+ * Temporary here to help the bring up of samples and integration tests that
+ * still use the 0.95 CompositeContext interface.
+ *
+ * @version $Rev$ $Date$
+ */
+public final class CurrentCompositeContext {
+    private static final ThreadLocal<CompositeContext> CURRENT_COMPONENT =
+        new InheritableThreadLocal<CompositeContext>();
+
+    /**
+     * Returns the current composite context associated with this thread.
+     *
+     * @return the current composite context
+     */
+    public static CompositeContext getContext() {
+        return CURRENT_COMPONENT.get();
+    }
+
+    /**
+     * Sets the composite context that is associated with this thread.
+     *
+     * @param context the context to associated with this thread; may be null
+     * @return the context previously associated with this thread; may be null
+     */
+    public static CompositeContext setContext(CompositeContext context) {
+        CompositeContext current = CURRENT_COMPONENT.get();
+        CURRENT_COMPONENT.set(context);
+        return current;
+    }
+}

Propchange: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CurrentCompositeContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/osoa/sca/CurrentCompositeContext.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/implementation/java/impl/JavaImplementationImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/implementation/java/impl/JavaImplementationImpl.java?view=diff&rev=527764&r1=527763&r2=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/implementation/java/impl/JavaImplementationImpl.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/implementation/java/impl/JavaImplementationImpl.java Wed Apr 11 21:20:58 2007
@@ -66,11 +66,16 @@
     
     @Override
     public boolean equals(Object obj) {
-        if (obj == this)
+        if (obj == this) {
             return true;
-        else if (obj instanceof JavaImplementation && getName().equals(((JavaImplementation)obj).getName()))
-             return true;
-        else
+        } else if (obj instanceof JavaImplementation) {
+            if (getName() != null) {
+                return getName().equals(((JavaImplementation)obj).getName());
+            } else {
+                return ((JavaImplementation)obj).getName() == null;
+            }
+        } else {
             return false;
+        }
     }
 }

Modified: incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/interfacedef/java/impl/JavaInterfaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/interfacedef/java/impl/JavaInterfaceImpl.java?view=diff&rev=527764&r1=527763&r2=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/interfacedef/java/impl/JavaInterfaceImpl.java (original)
+++ incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/interfacedef/java/impl/JavaInterfaceImpl.java Wed Apr 11 21:20:58 2007
@@ -76,11 +76,16 @@
     
     @Override
     public boolean equals(Object obj) {
-        if (obj == this)
+        if (obj == this) {
             return true;
-        else if (obj instanceof JavaInterface && getName().equals(((JavaInterface)obj).getName()))
-             return true;
-        else
+        } else if (obj instanceof JavaInterface) {
+            if (getName() != null) {
+                return getName().equals(((JavaInterface)obj).getName());
+            } else {
+                return ((JavaInterface)obj).getName() == null;
+            }
+        } else {
             return false;
+        }
     }
 }

Modified: incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLDefinitionImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLDefinitionImpl.java?view=diff&rev=527764&r1=527763&r2=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLDefinitionImpl.java (original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLDefinitionImpl.java Wed Apr 11 21:20:58 2007
@@ -81,11 +81,16 @@
     
     @Override
     public boolean equals(Object obj) {
-        if (obj == this)
+        if (obj == this) {
             return true;
-        else if (obj instanceof WSDLDefinition && getNamespace().equals(((WSDLDefinition)obj).getNamespace()))
-             return true;
-        else
+        } else if (obj instanceof WSDLDefinition) {
+            if (getNamespace() != null) {
+                return getNamespace().equals(((WSDLDefinition)obj).getNamespace());
+            } else {
+                return ((WSDLDefinition)obj).getNamespace() == null;
+            }
+        } else {
             return false;
+        }
     }
 }

Modified: incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLInterfaceImpl.java?view=diff&rev=527764&r1=527763&r2=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLInterfaceImpl.java (original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLInterfaceImpl.java Wed Apr 11 21:20:58 2007
@@ -68,11 +68,16 @@
     
     @Override
     public boolean equals(Object obj) {
-        if (obj == this)
+        if (obj == this) {
             return true;
-        else if (obj instanceof WSDLInterface && getName().equals(((WSDLInterface)obj).getName()))
-             return true;
-        else
+        } else if (obj instanceof WSDLInterface) {
+            if (getName() != null) {
+                return getName().equals(((WSDLInterface)obj).getName());
+            } else {
+                return ((WSDLInterface)obj).getName() == null;
+            }
+        } else {
             return false;
+        }
     }
 }

Modified: incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/XSDefinitionImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/XSDefinitionImpl.java?view=diff&rev=527764&r1=527763&r2=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/XSDefinitionImpl.java (original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/XSDefinitionImpl.java Wed Apr 11 21:20:58 2007
@@ -19,7 +19,6 @@
 
 package org.apache.tuscany.interfacedef.wsdl.impl;
 
-import org.apache.tuscany.interfacedef.wsdl.WSDLDefinition;
 import org.apache.tuscany.interfacedef.wsdl.XSDefinition;
 import org.apache.ws.commons.schema.XmlSchema;
 
@@ -75,11 +74,16 @@
     
     @Override
     public boolean equals(Object obj) {
-        if (obj == this)
+        if (obj == this) {
             return true;
-        else if (obj instanceof WSDLDefinition && getNamespace().equals(((WSDLDefinition)obj).getNamespace()))
-             return true;
-        else
+        } else if (obj instanceof XSDefinition) {
+            if (getNamespace() != null) {
+                return getNamespace().equals(((XSDefinition)obj).getNamespace());
+            } else {
+                return ((XSDefinition)obj).getNamespace() == null;
+            }
+        } else {
             return false;
+        }
     }
 }

Modified: incubator/tuscany/java/sca/modules/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/pom.xml?view=diff&rev=527764&r1=527763&r2=527764
==============================================================================
--- incubator/tuscany/java/sca/modules/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/pom.xml Wed Apr 11 21:20:58 2007
@@ -54,8 +54,8 @@
                 <module>core-spring</module>
                 <module>databinding</module>
                 <module>databinding-axiom</module>
-                <module>core-databinding</module>
                 <!--
+                <module>core-databinding</module>
                 <module>databinding-jaxb</module>
                 <module>databinding-sdo</module>
                 <module>databinding-sdo-axiom</module>



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