From: Janus Varmarken Date: Fri, 17 Aug 2018 21:38:14 +0000 (-0700) Subject: Conversation: replace RuntimeExceptions with AssertionErrors to properly communicate... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=70584b0c0547b12d670de196d36af66acad236fb;p=pingpong.git Conversation: replace RuntimeExceptions with AssertionErrors to properly communicate that the error is due to an internal mistake (invalid assumption about set of enum values) --- 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())); } }