From 759f26454a25f88b351d7387bcb4efbb87c8f8a3 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 15 Sep 2014 18:23:32 +0400 Subject: [PATCH] removed HashMap inherent ambiguity --- .../intellij/util/xmlb/XmlSerializerTest.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java b/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java index 8d0576c12405..71e785195eb8 100644 --- a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java +++ b/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java @@ -19,7 +19,6 @@ package com.intellij.util.xmlb; import com.intellij.openapi.util.JDOMUtil; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.util.containers.ContainerUtil; import com.intellij.util.xmlb.annotations.*; import junit.framework.AssertionFailedError; import junit.framework.TestCase; @@ -254,7 +253,7 @@ public class XmlSerializerTest extends TestCase { } public static class BeanWithMap { - public Map VALUES = new HashMap(); + public Map VALUES = new LinkedHashMap(); { VALUES.put("a", "1"); @@ -302,7 +301,7 @@ public class XmlSerializerTest extends TestCase { keyAttributeName = "name", valueAttributeName = "value" ) - public Map VALUES = new HashMap(); + public Map VALUES = new LinkedHashMap(); { VALUES.put("a", "1"); @@ -336,7 +335,7 @@ public class XmlSerializerTest extends TestCase { public static class BeanWithMapWithBeanValue { - public Map VALUES = new HashMap(); + public Map VALUES = new LinkedHashMap(); } public void testMapWithBeanValue() { @@ -519,7 +518,7 @@ public class XmlSerializerTest extends TestCase { Element element = serialize(bean, null); - Element node = (Element)element.getChildren().get(0); + Element node = element.getChildren().get(0); element.removeContent(node); element.addContent(node); @@ -1007,15 +1006,15 @@ public class XmlSerializerTest extends TestCase { } public static class BeanWithSetKeysInMap { - public Map, String> myMap = new HashMap, String>(); + public Map, String> myMap = new LinkedHashMap, String>(); } public void testSetKeysInMap() { final BeanWithSetKeysInMap bean = new BeanWithSetKeysInMap(); - bean.myMap.put(new HashSet(Arrays.asList("1", "2", "3")), "numbers"); - bean.myMap.put(new HashSet(Arrays.asList("a", "b", "c")), "letters"); + bean.myMap.put(new LinkedHashSet(Arrays.asList("a", "b", "c")), "letters"); + bean.myMap.put(new LinkedHashSet(Arrays.asList("1", "2", "3")), "numbers"); - BeanWithSetKeysInMap bb = (BeanWithSetKeysInMap)doSerializerTest( + BeanWithSetKeysInMap bb = doSerializerTest( "\n" + "