As it is right now, if the mapping is null we get a logger output a warning, but the program continues and throws a NPE. I`d prefer if it did something like this instead:
[java]# This patch file was generated by NetBeans IDE
It uses platform neutral UTF-8 encoding and \n newlines.
— Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -602,8 +602,7 @@
if (mapping == null) {
//throw new IllegalArgumentException("Cannot find mapping: " + mappingName);
logger.log(Level.WARNING, “Cannot find mapping to be removed, skipping: {0}”, mappingName);
-
}
-
} else { ArrayList<Integer> triggers = mapping.triggers; for (int i = triggers.size() - 1; i >= 0; i--) { int hash = triggers.get(i);
@@ -611,6 +610,7 @@
maps.remove(mapping);
}
}
-
}
/**
- Deletes a specific trigger registered to a mapping.
[/java]
- Deletes a specific trigger registered to a mapping.