From bc01f6a39edc4469cbf102daf73ebd4a573afa31 Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 11 Oct 2012 15:34:55 +0400 Subject: [PATCH] temporary reverted to fix SOE --- .../intellij/util/xmlb/XmlSerializerImpl.java | 2 +- .../intellij/util/xmlb/XmlSerializerTest.java | 36 ------------------- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/platform/util/src/com/intellij/util/xmlb/XmlSerializerImpl.java b/platform/util/src/com/intellij/util/xmlb/XmlSerializerImpl.java index 19823a2498ae..3a1cda4928a0 100644 --- a/platform/util/src/com/intellij/util/xmlb/XmlSerializerImpl.java +++ b/platform/util/src/com/intellij/util/xmlb/XmlSerializerImpl.java @@ -79,8 +79,8 @@ class XmlSerializerImpl { Binding binding = map.get(p); if (binding == null) { binding = _getNonCachedClassBinding(aClass, accessor, originalType); - binding.init(); map.put(p, binding); + binding.init(); } return binding; diff --git a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java b/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java index be5022399033..5879e223de30 100644 --- a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java +++ b/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java @@ -18,13 +18,11 @@ package com.intellij.util.xmlb; import com.intellij.openapi.util.JDOMUtil; import com.intellij.util.xmlb.annotations.*; -import junit.framework.AssertionFailedError; import junit.framework.TestCase; import org.jdom.Element; import java.util.*; import java.util.Collection; -import java.util.concurrent.atomic.AtomicReference; /** * @author mike @@ -440,40 +438,6 @@ public class XmlSerializerTest extends TestCase { public String STRING_V = "hello"; } - public void testParallelDeserialization() throws InterruptedException { - final Element e = new Element("root").addContent(new Element("name").setText("x")); - XmlSerializer.deserialize(e, BeanWithArray.class);//to initialize XmlSerializerImpl.ourBindings - Thread[] threads = new Thread[5]; - final AtomicReference exc = new AtomicReference(); - for (int i = 0; i < threads.length; i++) { - threads[i] = new Thread("XmlSerializerTest#testParallelDeserialization-" + i) { - @Override - public void run() { - try { - for (int j = 0; j < 10; j++) { - BeanWithFieldWithTagAnnotation bean = XmlSerializer.deserialize(e, BeanWithFieldWithTagAnnotation.class); - assertNotNull(bean); - assertEquals("x", bean.STRING_V); - } - } - catch (AssertionFailedError e) { - exc.set(e); - } - } - }; - } - for (Thread thread : threads) { - thread.start(); - } - for (Thread thread : threads) { - thread.join(); - } - AssertionFailedError error = exc.get(); - if (error != null) { - throw error; - } - } - public void testFieldWithTagAnnotation() { BeanWithFieldWithTagAnnotation bean = new BeanWithFieldWithTagAnnotation();