Fixing a bug: should use equals() to compare the values of Integer objects.
authorrtrimana <rtrimana@uci.edu>
Tue, 22 Sep 2020 18:53:43 +0000 (11:53 -0700)
committerrtrimana <rtrimana@uci.edu>
Tue, 22 Sep 2020 18:53:43 +0000 (11:53 -0700)
src/main/gov/nasa/jpf/listener/DPORStateReducerEfficient.java

index c31b912..c0a7db5 100644 (file)
@@ -702,7 +702,7 @@ public class DPORStateReducerEfficient extends ListenerAdapter {
         String writeField = entry.getKey();
         // Remove the entry from rwSet if both field and object ID are the same
         if (writeMap.containsKey(writeField) &&
-                (writeMap.get(writeField) == recordedWriteMap.get(writeField))) {
+                (writeMap.get(writeField).equals(recordedWriteMap.get(writeField)))) {
           writeMap.remove(writeField);
         }
       }
@@ -715,7 +715,7 @@ public class DPORStateReducerEfficient extends ListenerAdapter {
         String readField = entry.getKey();
         // Remove the entry from rwSet if both field and object ID are the same
         if (readMap.containsKey(readField) &&
-                (readMap.get(readField) == recordedReadMap.get(readField))) {
+                (readMap.get(readField).equals(recordedReadMap.get(readField)))) {
           readMap.remove(readField);
         }
       }