Merge "Added the link to the architecture documentation"
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / utils / EcompPortalUtils.java
index efd84b9..53b69d7 100644 (file)
@@ -33,7 +33,7 @@
  *
  * ============LICENSE_END============================================
  *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * 
  */
 package org.onap.portalapp.portal.utils;
 
@@ -269,7 +269,7 @@ public class EcompPortalUtils {
 
        public static String getFEErrorString(Boolean internal, int responseCode) {
                // Return a String like the following:
-               // "Internal Ecomp Error: 500 internal_server_error" or
+               // "Internal Onap Error: 500 internal_server_error" or
                // "External App Error: 404 not_found"
                // TODO: create our own Ecomp error codes, starting with 1000 and up.
                String internalExternalString = internal ? "Ecomp Error: " : "App Error: ";
@@ -513,7 +513,7 @@ public class EcompPortalUtils {
        
        /**
         * 
-        * It check whether the external auth namespace is matching with current namepsace exists in local DB
+        * It check whether the external auth namespace is matching with current namespace exists in local DB
         * 
         * @param permTypeVal
         * @param appNamespaceVal
@@ -523,9 +523,13 @@ public class EcompPortalUtils {
                String[] typeNamespace = permTypeVal.split("\\.");
                String[] appNamespace = appNamespaceVal.split("\\.");
                boolean isNamespaceMatching = true;
-               for (int k = 0; k < appNamespace.length; k++) {
-                       if (!appNamespace[k].equals(typeNamespace[k]))
-                               isNamespaceMatching = false;
+               if (appNamespace.length <= typeNamespace.length) {
+                       for (int k = 0; k < appNamespace.length; k++) {
+                               if (!appNamespace[k].equals(typeNamespace[k]))
+                                       isNamespaceMatching = false;
+                       }
+               } else {
+                       isNamespaceMatching = false;
                }
                return isNamespaceMatching;
        }