diff options
Diffstat (limited to 'configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java index d1cf011d33a..52bb8442982 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java @@ -838,15 +838,14 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye public void validateThatSessionIsNotActive(Tenant tenant, long sessionId) { Session session = getRemoteSession(tenant, sessionId); - if (Session.Status.ACTIVATE.equals(session.getStatus())) { - throw new IllegalStateException("Session is active: " + sessionId); - } + if (Session.Status.ACTIVATE == session.getStatus()) + throw new IllegalArgumentException("Session is active: " + sessionId); } public void validateThatSessionIsPrepared(Tenant tenant, long sessionId) { Session session = getRemoteSession(tenant, sessionId); - if ( ! Session.Status.PREPARE.equals(session.getStatus())) - throw new IllegalStateException("Session not prepared: " + sessionId); + if ( Session.Status.PREPARE != session.getStatus()) + throw new IllegalArgumentException("Session not prepared: " + sessionId); } public long createSessionFromExisting(ApplicationId applicationId, boolean internalRedeploy, TimeoutBudget timeoutBudget) { |