diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/annotations.xml index de8b2e4271cd..081f097ab184 100644 --- a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/annotations.xml +++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/java/util/annotations.xml @@ -2252,6 +2252,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/mockJDK-1.7/jre/lib/rt.jar b/java/mockJDK-1.7/jre/lib/rt.jar index 7448aea6309a..043d1ca20ba7 100644 Binary files a/java/mockJDK-1.7/jre/lib/rt.jar and b/java/mockJDK-1.7/jre/lib/rt.jar differ diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/LightGroovyTestCase.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/LightGroovyTestCase.groovy index 88314b916740..e26d327a2e06 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/LightGroovyTestCase.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/LightGroovyTestCase.groovy @@ -102,19 +102,6 @@ public class HashSet ''') } - protected final void addLinkedHashMap() { - myFixture.addClass """\ -package java.util; - -public class LinkedHashMap extends HashMap implements Map { - public LinkedHashMap(int initialCapacity, float loadFactor) {} - public LinkedHashMap(int initialCapacity) {} - public LinkedHashMap() {} - public LinkedHashMap(Map m) {} - public LinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder) {} -}""" - } - protected final void addAnnotationCollector() { myFixture.addClass '''\ package groovy.transform; diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyMapAttributeTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyMapAttributeTest.groovy index 64b523819838..2bc331fa541a 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyMapAttributeTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyMapAttributeTest.groovy @@ -398,7 +398,7 @@ println(new CccMap(foo: [:])) println(new CccList(foo: [])) println(new CccMap(foo: [])) -println(new CccList(foo: [:])) +println(new CccList(foo: [:])) """ } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/LiteralConstructorUsagesTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/LiteralConstructorUsagesTest.groovy index db2521aac1c0..6386f060d195 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/LiteralConstructorUsagesTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/LiteralConstructorUsagesTest.groovy @@ -47,7 +47,6 @@ class LiteralConstructorUsagesTest extends LightGroovyTestCase { } void testLiteralConstructorWithNamedArgs() { - addLinkedHashMap() myFixture.addFileToProject "a.groovy", """\ import groovy.transform.Immutable diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GrAssignabilityTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GrAssignabilityTest.groovy index 2f76c04fc139..f39097bcff96 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GrAssignabilityTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GrAssignabilityTest.groovy @@ -493,7 +493,6 @@ static bar(String s) { } void testLiteralConstructorWithNamedArgs() { - addLinkedHashMap() testHighlighting('''\ import groovy.transform.Immutable diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolveWithDelegatesToTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolveWithDelegatesToTest.groovy index efe2c05ec499..85d622642b05 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolveWithDelegatesToTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolveWithDelegatesToTest.groovy @@ -303,7 +303,6 @@ public @interface DelegatesTo { } void testNamedArgs() { - addLinkedHashMap() assertScript ''' def with(@DelegatesTo.Target Object target, @DelegatesTo(strategy = Closure.DELEGATE_FIRST) Closure arg) { for (Closure a : arg) { @@ -321,12 +320,10 @@ def test() { } test() -''', 'HashMap' +''', 'LinkedHashMap' } void testEllipsisArgs() { - addLinkedHashMap() - assertScript ''' def with(@DelegatesTo.Target Object target, @DelegatesTo(strategy = Closure.DELEGATE_FIRST) Closure... arg) { for (Closure a : arg) { @@ -347,7 +344,7 @@ def test() { test() -''', 'HashMap' +''', 'LinkedHashMap' } void testShouldChooseMethodFromOwnerInJava() { myFixture.configureByText("Abc.java", '''\ @@ -567,7 +564,6 @@ class Abc { } ''') - addLinkedHashMap() assertScript ''' @CompileStatic def test() { @@ -577,7 +573,7 @@ def test() { } test() -''', 'HashMap' +''', 'LinkedHashMap' } void testEllipsisArgsInJava() { @@ -596,8 +592,6 @@ class Abc { } ''') - addLinkedHashMap() - assertScript ''' @CompileStatic def test() { @@ -610,7 +604,7 @@ def test() { test() -''', 'HashMap' +''', 'LinkedHashMap' } void testTarget() { @@ -634,7 +628,6 @@ foo(4) { } void testGenericTypeIndex() { - addLinkedHashMap() assertScript('''\ public void foo(@DelegatesTo.Target Map map, @DelegatesTo(genericTypeIndex = 1) Closure c) {} @@ -645,7 +638,6 @@ foo([1:'ab', 2:'cde']) { } void testGenericTypeIndex1() { - addLinkedHashMap() assertScript('''\ public void foo(@DelegatesTo.Target Map map, @DelegatesTo(genericTypeIndex = 0) Closure c) {} diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/TypeInferenceTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/TypeInferenceTest.groovy index 4b50ef8fc845..24cfdedf958e 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/TypeInferenceTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/TypeInferenceTest.groovy @@ -289,7 +289,7 @@ List l2 } void testIndexPropertyInLHS() { - assertTypeEquals("java.util.Map", 'a.groovy') + assertTypeEquals("java.util.LinkedHashMap", 'a.groovy') } void testEmptyMapTypeArgs() { @@ -300,7 +300,7 @@ X x = [:] ''') def type = ((myFixture.file as GroovyFile).statements[0] as GrVariableDeclaration).variables[0].initializerGroovy.type - assertEquals("java.util.Map", type.canonicalText) + assertEquals("java.util.LinkedHashMap", type.canonicalText) } void testRawCollectionsInCasts() { @@ -411,7 +411,7 @@ print list doTest('''\ def map = cond ? [1:'a', 2:'a', 3:'a'] : [:] print map -''', "$JAVA_UTIL_MAP<$JAVA_LANG_STRING, $JAVA_LANG_STRING>") +''', "java.util.LinkedHashMap<$JAVA_LANG_STRING, $JAVA_LANG_STRING>") } void testEmptyMapOrMapWithGenerics2() { @@ -702,7 +702,7 @@ def foo(Map map) { while(true) map = [a:map] } -''', 'java.util.Map') +''', 'java.util.LinkedHashMap') } void testRecursionWithLists() { diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/convertToJava/FileGenerationTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/convertToJava/FileGenerationTest.groovy index 0cb9e0f37ecc..5605f20aa7ef 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/convertToJava/FileGenerationTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/convertToJava/FileGenerationTest.groovy @@ -27,8 +27,6 @@ class FileGenerationTest extends LightGroovyTestCase { final String basePath = TestUtils.testDataPath + 'refactoring/convertGroovyToJava/file' private void doTest() { - addLinkedHashMap() - final String testName = getTestName(true) final PsiFile file = myFixture.configureByFile("${testName}.groovy"); assertInstanceOf file, GroovyFile diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/spock/SpockTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/spock/SpockTest.groovy index 4df8d7b92392..3f1f0a120c39 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/spock/SpockTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/spock/SpockTest.groovy @@ -106,7 +106,7 @@ class FooSpec extends spock.lang.Specification { } public void testShlSimple() { - doTest(CommonClassNames.JAVA_UTIL_MAP, """ + doTest(AbstractMap.name, """ class FooSpec extends spock.lang.Specification { def "foo test"() { expect: diff --git a/plugins/groovy/testdata/refactoring/convertGroovyToJava/codeBlock/emptyMap.java b/plugins/groovy/testdata/refactoring/convertGroovyToJava/codeBlock/emptyMap.java index 75eabcd8e91c..41047346ebfb 100644 --- a/plugins/groovy/testdata/refactoring/convertGroovyToJava/codeBlock/emptyMap.java +++ b/plugins/groovy/testdata/refactoring/convertGroovyToJava/codeBlock/emptyMap.java @@ -1,2 +1,2 @@ -java.util.Map map = new java.util.Map(); +java.util.LinkedHashMap map = new java.util.LinkedHashMap(); print(map.get(1)); diff --git a/plugins/groovy/testdata/refactoring/convertGroovyToJava/codeBlock/mapNameAlreadyused.java b/plugins/groovy/testdata/refactoring/convertGroovyToJava/codeBlock/mapNameAlreadyused.java index ef26225e670c..986c1b153402 100644 --- a/plugins/groovy/testdata/refactoring/convertGroovyToJava/codeBlock/mapNameAlreadyused.java +++ b/plugins/groovy/testdata/refactoring/convertGroovyToJava/codeBlock/mapNameAlreadyused.java @@ -1,4 +1,4 @@ -java.util.Map map1 = new java.util.Map(1); +java.util.LinkedHashMap map1 = new java.util.LinkedHashMap(1); map1.put("1", 2); -java.util.Map map = map1; +java.util.LinkedHashMap map = map1; print(map.get("1"));