From de8f2a63ce71e50cf95da6c1ad1352e45bbc8493 Mon Sep 17 00:00:00 2001 From: sherman Date: Fri, 2 Sep 2011 10:20:08 -0700 Subject: [PATCH] 6898310: (cs) Charset cache lookups should be synchronized Summary: synchronize the lookup in iterator Reviewed-by: alanb --- src/share/classes/sun/nio/cs/AbstractCharsetProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java b/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java index f1714ea39..60d989654 100644 --- a/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java +++ b/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java @@ -179,7 +179,9 @@ public class AbstractCharsetProvider public Charset next() { String csn = i.next(); - return lookup(csn); + synchronized (AbstractCharsetProvider.this) { + return lookup(csn); + } } public void remove() { -- GitLab