From 346900443234b2d39b07007b8878fe4f2905569c Mon Sep 17 00:00:00 2001 From: Derek Perez Date: Tue, 15 Aug 2017 12:41:22 -0700 Subject: [PATCH] Adding explicit comment about case statement Motivation: When compiling this code and running it through errorprone[1], this message appears: ``` StringUtil.java:493: error: [FallThrough] Switch case may fall through; add a `// fall through` comment if it was deliberate case LINE_FEED: ^ (see http://errorprone.info/bugpattern/FallThrough) ``` By adding that comment, it silences the error and also makes clear the intention of that statement. [1]http://errorprone.info/index Modification: Add simple comment. Result: Errorprone is happier with the code. --- common/src/main/java/io/netty/util/internal/StringUtil.java | 1 + 1 file changed, 1 insertion(+) diff --git a/common/src/main/java/io/netty/util/internal/StringUtil.java b/common/src/main/java/io/netty/util/internal/StringUtil.java index c049b6a7e5..14fe2c1d22 100644 --- a/common/src/main/java/io/netty/util/internal/StringUtil.java +++ b/common/src/main/java/io/netty/util/internal/StringUtil.java @@ -491,6 +491,7 @@ public final class StringUtil { } // double-quote appears without being enclosed with double-quotes case LINE_FEED: + // fall through case CARRIAGE_RETURN: // special characters appears without being enclosed with double-quotes throw newInvalidEscapedCsvFieldException(value, i);