/**
*
- * 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;
}