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.
This commit is contained in:
Derek Perez 2017-08-15 12:41:22 -07:00 committed by Norman Maurer
parent e487db7836
commit 3469004432

View File

@ -491,6 +491,7 @@ public final class StringUtil {
} }
// double-quote appears without being enclosed with double-quotes // double-quote appears without being enclosed with double-quotes
case LINE_FEED: case LINE_FEED:
// fall through
case CARRIAGE_RETURN: case CARRIAGE_RETURN:
// special characters appears without being enclosed with double-quotes // special characters appears without being enclosed with double-quotes
throw newInvalidEscapedCsvFieldException(value, i); throw newInvalidEscapedCsvFieldException(value, i);