changeset 4374:c162f8fc4adc

6898310: (cs) Charset cache lookups should be synchronized Summary: synchronize the lookup in iterator Reviewed-by: alanb
author sherman
date Tue, 06 Sep 2011 10:51:28 -0700
parents de8f5909f8ad
children d8b5c0186736
files src/share/classes/sun/nio/cs/AbstractCharsetProvider.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java	Tue Sep 06 17:52:07 2011 +0400
+++ b/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java	Tue Sep 06 10:51:28 2011 -0700
@@ -179,7 +179,9 @@
 
                 public Charset next() {
                     String csn = i.next();
-                    return lookup(csn);
+                    synchronized (AbstractCharsetProvider.this) {
+                        return lookup(csn);
+                    }
                 }
 
                 public void remove() {