Conversation: replace RuntimeExceptions with AssertionErrors to properly communicate...
authorJanus Varmarken <varmarken@gmail.com>
Fri, 17 Aug 2018 21:38:14 +0000 (14:38 -0700)
committerJanus Varmarken <varmarken@gmail.com>
Sun, 19 Aug 2018 07:07:34 +0000 (00:07 -0700)
Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/Conversation.java

index 05d97e3924b45afa55e198361300e26bbfa287a1..b8681f53748345815d923fdaa1afb7e0470054c3 100644 (file)
@@ -370,7 +370,7 @@ public class Conversation {
             case SERVER_TO_CLIENT:
                 return mSeqNumbersSrv.contains(seqNo);
             default:
-                throw new RuntimeException(String.format("Unexpected value of enum '%s'",
+                throw new AssertionError(String.format("Unexpected value of enum '%s'",
                         Direction.class.getSimpleName()));
         }
     }
@@ -399,7 +399,7 @@ public class Conversation {
                 mSeqNumbersSrv.add(seqNo);
                 break;
             default:
-                throw new RuntimeException(String.format("Unexpected value of enum '%s'",
+                throw new AssertionError(String.format("Unexpected value of enum '%s'",
                         Direction.class.getSimpleName()));
         }
     }