*
* ============LICENSE_END============================================
*
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ *
*/
package org.onap.portalapp.portal.utils;
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: ";
/**
*
- * 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
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;
}