[482859] Failure to check namespace in OpenOnSelectionHelper - 3.7.2
diff --git a/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
index e3b9f49..aaeee09 100644
--- a/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %_UI_PLUGIN_NAME
 Bundle-SymbolicName: org.eclipse.wst.xsd.ui; singleton:=true
-Bundle-Version: 1.2.500.qualifier
+Bundle-Version: 1.2.510.qualifier
 Bundle-Activator: org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.xsd.ui/pom.xml b/bundles/org.eclipse.wst.xsd.ui/pom.xml
index f8fef9f..f624921 100644
--- a/bundles/org.eclipse.wst.xsd.ui/pom.xml
+++ b/bundles/org.eclipse.wst.xsd.ui/pom.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright (c) 2012, 2013 Eclipse Foundation and others.
+  Copyright (c) 2012, 2015 Eclipse Foundation and others.
   All rights reserved. This program and the accompanying materials
   are made available under the terms of the Eclipse Distribution License v1.0
   which accompanies this distribution, and is available at
@@ -22,7 +22,7 @@
 
   <groupId>org.eclipse.webtools.sourceediting</groupId>
   <artifactId>org.eclipse.wst.xsd.ui</artifactId>
-  <version>1.2.500-SNAPSHOT</version>
+  <version>1.2.510-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
   
    <!--  added this "constraint" for bug 458962 -->
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/utils/OpenOnSelectionHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/utils/OpenOnSelectionHelper.java
index be1aa78..d6d70c6 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/utils/OpenOnSelectionHelper.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/utils/OpenOnSelectionHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2015 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -161,9 +161,11 @@
   {
     XSDSchema schema = xsdSchema;
     String name = null;
+    String namespace = null;
     if (comp instanceof XSDNamedComponent)
     {
       name = ((XSDNamedComponent) comp).getName();
+      namespace = ((XSDNamedComponent) comp).getTargetNamespace();
     }
     if (name == null)
     {
@@ -175,6 +177,7 @@
         if (comp instanceof XSDNamedComponent)
         {
           name = ((XSDNamedComponent) comp).getName();
+          namespace = ((XSDNamedComponent) comp).getTargetNamespace();
         }
       }
     }
@@ -210,19 +213,34 @@
       objects = schema.getAttributeDeclarations();
     }
 
-    if (objects != null)
-    {
-      for (Iterator iter = objects.iterator(); iter.hasNext();)
-      {
-        XSDNamedComponent namedComp = (XSDNamedComponent) iter.next();
-        
-        if (namedComp.getName().equals(name))
-        {
-          revealObject(namedComp);
-          return namedComp;
-        }
-      }
-    }
+	if (objects != null)
+	{
+		if (namespace != null)
+		{
+			// First, look for a namespace and name match
+			for (Iterator iter = objects.iterator(); iter.hasNext();)
+			{
+				XSDNamedComponent namedComp = (XSDNamedComponent) iter.next();
+				String targetNamespace = namedComp.getTargetNamespace();
+				if (namedComp.getName().equals(name) && targetNamespace != null && targetNamespace.equals(namespace))
+				{
+					revealObject(namedComp);
+					return namedComp;
+				}
+			}
+		}
+
+		// Next, look for just a name match
+		for (Iterator iter = objects.iterator(); iter.hasNext();)
+		{
+			XSDNamedComponent namedComp = (XSDNamedComponent) iter.next();
+			if (namedComp.getName().equals(name))
+			{
+				revealObject(namedComp);
+				return namedComp;
+			}
+		}
+	}
     return null;
   }