diff options
Diffstat (limited to 'src/main/java/au/id/zancanaro/javacheck/state')
-rw-r--r-- | src/main/java/au/id/zancanaro/javacheck/state/CommandValue.java | 4 | ||||
-rw-r--r-- | src/main/java/au/id/zancanaro/javacheck/state/GeneratedCommand.java | 10 |
2 files changed, 5 insertions, 9 deletions
diff --git a/src/main/java/au/id/zancanaro/javacheck/state/CommandValue.java b/src/main/java/au/id/zancanaro/javacheck/state/CommandValue.java index 1ca51a9..d2f3419 100644 --- a/src/main/java/au/id/zancanaro/javacheck/state/CommandValue.java +++ b/src/main/java/au/id/zancanaro/javacheck/state/CommandValue.java @@ -46,8 +46,8 @@ public class CommandValue<T> { @SuppressWarnings("unchecked") public T get() { - if (values.containsKey(getId())) { - return (T) values.get(getId()); + if (values.containsKey(id)) { + return (T) values.get(id); } else { throw new NoSuchElementException("Concrete values cannot be supplied prior to being calculated"); } diff --git a/src/main/java/au/id/zancanaro/javacheck/state/GeneratedCommand.java b/src/main/java/au/id/zancanaro/javacheck/state/GeneratedCommand.java index 23f306b..92a90f9 100644 --- a/src/main/java/au/id/zancanaro/javacheck/state/GeneratedCommand.java +++ b/src/main/java/au/id/zancanaro/javacheck/state/GeneratedCommand.java @@ -30,19 +30,15 @@ public class GeneratedCommand<S, A, R> { GeneratedCommand that = (GeneratedCommand) o; - if (args != null ? !args.equals(that.args) : that.args != null) - return false; - if (command != null ? !command.equals(that.command) : that.command != null) - return false; + return !(args != null ? !args.equals(that.args) : that.args != null) + && !(command != null ? !command.equals(that.command) : that.command != null); - return true; } @Override public int hashCode() { int result = command != null ? command.hashCode() : 0; - result = 31 * result + (args != null ? args.hashCode() : 0); - return result; + return 31 * result + (args != null ? args.hashCode() : 0); } @Override |