From e700c7d888d36c44d648cff6344c876f71c0bba8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 6 Jan 2013 22:39:09 +0100 Subject: [PATCH] Rename method. --- src/main/java/net/pterodactylus/reactor/engine/Engine.java | 4 ++-- src/main/java/net/pterodactylus/reactor/states/StateManager.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/reactor/engine/Engine.java b/src/main/java/net/pterodactylus/reactor/engine/Engine.java index 64f2c83..e82267c 100644 --- a/src/main/java/net/pterodactylus/reactor/engine/Engine.java +++ b/src/main/java/net/pterodactylus/reactor/engine/Engine.java @@ -118,7 +118,7 @@ public class Engine extends AbstractExecutionThreadService { Reaction nextReaction; synchronized (reactions) { for (Entry reactionEntry : reactions.entrySet()) { - net.pterodactylus.reactor.State state = stateManager.loadState(reactionEntry.getKey()); + net.pterodactylus.reactor.State state = stateManager.loadLastState(reactionEntry.getKey()); long stateTime = (state != null) ? state.time() : 0; nextReactions.put(stateTime + reactionEntry.getValue().updateInterval(), Pair.of(reactionEntry.getKey(), reactionEntry.getValue())); } @@ -128,7 +128,7 @@ public class Engine extends AbstractExecutionThreadService { logger.debug(String.format("Next Reaction: %s.", nextReaction)); /* wait until the next reaction has to run. */ - net.pterodactylus.reactor.State lastState = stateManager.loadState(reactionName); + net.pterodactylus.reactor.State lastState = stateManager.loadLastState(reactionName); long lastStateTime = (lastState != null) ? lastState.time() : 0; int lastStateFailCount = (lastState != null) ? lastState.failCount() : 0; long waitTime = (lastStateTime + nextReaction.updateInterval()) - System.currentTimeMillis(); diff --git a/src/main/java/net/pterodactylus/reactor/states/StateManager.java b/src/main/java/net/pterodactylus/reactor/states/StateManager.java index cd0af2c..d9d6d56 100644 --- a/src/main/java/net/pterodactylus/reactor/states/StateManager.java +++ b/src/main/java/net/pterodactylus/reactor/states/StateManager.java @@ -60,14 +60,14 @@ public class StateManager { // /** - * Loads the state with the given name. + * Loads the last state with the given name. * * @param reactionName * The name of the reaction * @return The loaded state, or {@code null} if the state could not be * loaded */ - public State loadState(String reactionName) { + public State loadLastState(String reactionName) { File stateFile = stateFile(reactionName); try { State state = objectMapper.readValue(stateFile, AbstractState.class); -- 2.7.4