You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/02/26 22:49:21 UTC
[GitHub] ctubbsii commented on a change in pull request #991: Fix code
quality alerts found by lgtm
ctubbsii commented on a change in pull request #991: Fix code quality alerts found by lgtm
URL: https://github.com/apache/accumulo/pull/991#discussion_r260523872
##########
File path: core/src/test/java/org/apache/accumulo/core/clientImpl/lexicoder/ByteUtilsTest.java
##########
@@ -78,8 +83,9 @@ public void testEscape() {
byte[] escaped = ByteUtils.escape(bytes);
assertArrayEquals(bytes, ByteUtils.unescape(escaped));
- // these bytes would cause an ArrayIndexOutOfBounds in the past
- byte[] errorBytes = {0x01, 0x01, 0x01};
+ // incomplete bytes would cause an ArrayIndexOutOfBounds in the past
+ exception.expect(IllegalArgumentException.class);
Review comment:
+1 to that comment. exception expectations should be declared immediately prior to the invocation that triggers the exception, and a call to `fail()` should be used immediately after that invocation.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services