From 70584b0c0547b12d670de196d36af66acad236fb Mon Sep 17 00:00:00 2001 From: Janus Varmarken Date: Fri, 17 Aug 2018 14:38:14 -0700 Subject: [PATCH] Conversation: replace RuntimeExceptions with AssertionErrors to properly communicate that the error is due to an internal mistake (invalid assumption about set of enum values) --- .../src/main/java/edu/uci/iotproject/Conversation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/Conversation.java b/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/Conversation.java index 05d97e3..b8681f5 100644 --- a/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/Conversation.java +++ b/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/Conversation.java @@ -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())); } } -- 2.34.1