Hooks: Fix recursive adding to mappings.

This commit is contained in:
asofold 2012-08-10 15:42:05 +02:00
parent d2d4517612
commit ba6e2e5a5d

View File

@ -128,16 +128,22 @@ public final class NCPHookManager {
* @param checkType * @param checkType
* @param refType * @param refType
* @param hook * @param hook
* @return If the
*/ */
private static void addToMappingsRecursively(final CheckType checkType, CheckType refType, final NCPHook hook) { private static boolean addToMappingsRecursively(final CheckType checkType, final CheckType refType, final NCPHook hook) {
if (refType.group == null) if (refType.group == null)
return; return false;
else if (refType.group == checkType){ else if (refType.group == checkType){
addToMapping(refType, hook); addToMapping(refType, hook);
return; return true;
} }
else else {
addToMappingsRecursively(checkType, refType.group, hook); if (addToMappingsRecursively(checkType, refType.group, hook)){
addToMapping(refType, hook);
return true;
}
else return false;
}
} }
/** /**