[LANG-1476] Added sync for iterating over synced set
This commit is contained in:
parent
92e7839659
commit
d20e4f53af
|
@ -237,9 +237,11 @@ public class CharSet implements Serializable {
|
|||
* @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;
|
||||
|
|
Loading…
Reference in New Issue