From 26cdd7ba561c736de930d18ebb14610b5b6ace85 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Thu, 4 Mar 2010 02:57:03 +0000 Subject: [PATCH] Iterator is not threadsafe Make private field final git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918829 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/java/org/apache/commons/lang3/CharRange.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/lang3/CharRange.java b/src/main/java/org/apache/commons/lang3/CharRange.java index d6efea506..80506bae0 100644 --- a/src/main/java/org/apache/commons/lang3/CharRange.java +++ b/src/main/java/org/apache/commons/lang3/CharRange.java @@ -254,6 +254,7 @@ public final class CharRange implements Iterable, Serializable { /** *

Returns an iterator which can be used to walk through the characters described by this range.

* + *

#NotThreadSafe# the iterator is not threadsafe

* @return an iterator to the chars represented by this range * @since 2.5 */ @@ -263,12 +264,13 @@ public final class CharRange implements Iterable, Serializable { /** * Character {@link Iterator}. + *

#NotThreadSafe#

*/ private static class CharacterIterator implements Iterator { /** The current character */ private char current; - private CharRange range; + private final CharRange range; private boolean hasNext; /**