From ae9f8521623fabe1a890a6358e4643c85589f7ac Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Fri, 12 Oct 2018 14:25:33 +0200 Subject: [PATCH] imported patch rewardcounter-ProductState-int.patch --- prism/src/explicit/ProductState.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/prism/src/explicit/ProductState.java b/prism/src/explicit/ProductState.java index 35b96cfd..1b35f764 100644 --- a/prism/src/explicit/ProductState.java +++ b/prism/src/explicit/ProductState.java @@ -36,25 +36,25 @@ package explicit; public class ProductState implements Comparable { /** The first state */ - private Integer state_1; + private int state_1; /** The second state */ - private Integer state_2; + private int state_2; /** Constructor */ - public ProductState(Integer state_1, Integer state_2) + public ProductState(int state_1, int state_2) { this.state_1 = state_1; this.state_2 = state_2; } /** Get the first state */ - public Integer getFirstState() + public int getFirstState() { return state_1; } /** Get the second state */ - public Integer getSecondState() + public int getSecondState() { return state_2; } @@ -68,9 +68,9 @@ public class ProductState implements Comparable @Override public int compareTo(ProductState other) { - int rv = state_1.compareTo(state_2); + int rv = Integer.compare(state_1, state_2); if (rv == 0) { - return state_2.compareTo(other.state_2); + return Integer.compare(state_1, state_2); } else { return rv; } @@ -81,8 +81,8 @@ public class ProductState implements Comparable { final int prime = 31; int result = 1; - result = prime * result + ((state_1 == null) ? 0 : state_1.hashCode()); - result = prime * result + ((state_2 == null) ? 0 : state_2.hashCode()); + result = prime * result + Integer.hashCode(state_1); + result = prime * result + Integer.hashCode(state_2); return result; } @@ -96,7 +96,7 @@ public class ProductState implements Comparable if (getClass() != obj.getClass()) return false; ProductState other = (ProductState) obj; - return state_1.equals(other.state_1) && - state_2.equals(other.state_2); + return state_1 == other.state_1 && + state_2 == other.state_2; } }