[LANG-1476] Added sync for iterating over synced set

This commit is contained in:
emopers 2019-01-09 03:35:27 -06:00 committed by Bruno P. Kinoshita
parent 92e7839659
commit d20e4f53af
1 changed files with 5 additions and 3 deletions

View File

@ -237,9 +237,11 @@ protected void add(final String str) {
* @return {@code true} if the set contains the characters
*/
public boolean contains(final char ch) {
for (final CharRange range : set) {
if (range.contains(ch)) {
return true;
synchronized(set) {
for (final CharRange range : set) {
if (range.contains(ch)) {
return true;
}
}
}
return false;