Skip to content

Commit

Permalink
Document the non-guava String.split fix
Browse files Browse the repository at this point in the history
Fixes #899

RELNOTES: N/A

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182158360
  • Loading branch information
cushon committed Jan 18, 2018
1 parent 2e6c35c commit 66955c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/bugpattern/StringSplit.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ Prefer guava's
[`String.splitter`](http://google.github.io/guava/releases/23.0/api/docs/com/google/common/base/Splitter.html),
which has more predicitable behaviour and provides explicit control over the
handling of empty strings and the trimming of whitespace.

Alternately, consider using [`String.split(String,
int)`](https://docs.oracle.com/javase/9/docs/api/java/lang/String.html#split-java.lang.String-int-)
and setting an explicit 'limit'.

TIP: consider extracting the `Splitter` instance to a static final field.
4 changes: 4 additions & 0 deletions docs/bugpattern/StringSplitter.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ Prefer guava's
which has more predicitable behaviour and provides explicit control over the
handling of empty strings and the trimming of whitespace.

Alternately, consider using [`String.split(String,
int)`](https://docs.oracle.com/javase/9/docs/api/java/lang/String.html#split-java.lang.String-int-)
and setting an explicit 'limit'.

TIP: consider extracting the `Splitter` instance to a static final field.

0 comments on commit 66955c5

Please sign in to comment.