mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
temporary reverted to fix SOE
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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<AssertionFailedError> exc = new AtomicReference<AssertionFailedError>();
|
||||
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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user