Throw AssertionError to make intent clearer.

This commit is contained in:
akwizgran
2018-10-29 17:02:07 +00:00
parent eb3983f6b2
commit 0d7e4feaf2
2 changed files with 3 additions and 3 deletions

View File

@@ -47,7 +47,7 @@ public class StringUtils {
try {
return s.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
throw new AssertionError(e);
}
}
@@ -63,7 +63,7 @@ public class StringUtils {
try {
return decoder.decode(buffer).toString();
} catch (CharacterCodingException e) {
throw new RuntimeException(e);
throw new AssertionError(e);
}
}

View File

@@ -476,7 +476,7 @@ class ModemImpl implements Modem, WriteHandler, SerialPortEventListener {
try {
return decoder.decode(buffer).toString();
} catch (CharacterCodingException e) {
throw new RuntimeException(e);
throw new AssertionError(e);
}
}
}