Allow updating of reactions without having to remove them first.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 6 Jan 2013 16:21:31 +0000 (17:21 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 6 Jan 2013 16:21:31 +0000 (17:21 +0100)
src/main/java/net/pterodactylus/reactor/engine/Engine.java

index 7c50081..64f2c83 100644 (file)
@@ -64,15 +64,9 @@ public class Engine extends AbstractExecutionThreadService {
         *            The name of the reaction
         * @param reaction
         *            The reaction to add to this engine
-        * @throws IllegalStateException
-        *             if the engine already contains a {@link Reaction} with the
-        *             given name
         */
        public void addReaction(String name, Reaction reaction) {
                synchronized (reactions) {
-                       if (reactions.containsKey(name)) {
-                               throw new IllegalStateException(String.format("Engine already contains a Reaction named “%s!”", name));
-                       }
                        reactions.put(name, reaction);
                        reactions.notifyAll();
                }