Permalink
Browse files

Extraction comparation to a method

  • Loading branch information...
1 parent 10aa329 commit 94f5e77e164393cca3bacb761343fb3b32aa0e7a @carlasouza carlasouza committed Aug 3, 2011
@@ -156,23 +156,18 @@ protected void reaperVMM() throws ManageException, WorkspaceException {
Integer state = r.getState();
String VMname = r.getName();
if (vms.containsKey(VMname) && result.containsKey(VMname)) {
- if (result.get(VMname) > 3 && r.getState() > 6 && r.getState() < 14) {
+ if (isInconsistent(r.getState(), result.get(VMname))) {
this.persistence.setState(r.getID(),
WorkspaceConstants.STATE_CORRUPTED_GENERIC,
null);
}
}
-
}
- //TODO compare states with isInconsistent()
- }
-
- public int getCurrentState() {
- return 0;
}
- public static boolean isInconsistent(Integer state, Integer queriedState) {
- return state != null && state.equals(queriedState);
+ //FIXME it is hardcoded
+ private boolean isInconsistent(Integer state, Integer queriedState) {
+ return queriedState > 3 && state > 6 && state < 14;
}
}

0 comments on commit 94f5e77

Please sign in to comment.