Replace types that are imported by default via typealiases such as java.util.ArrayList with something else as it conflicts now with kotlin.collections.ArrayList and has to imported explicitly.

This commit is contained in:
Ilya Gorbunov
2016-09-02 17:15:04 +03:00
parent b7e2649b91
commit a62cda8365
47 changed files with 68 additions and 72 deletions
@@ -2,5 +2,5 @@ fun main(args: Array<String>) {
<caret>val a = 1
}
// ELEMENT: ArrayList
// TAIL_TEXT: <E> (java.util)
// ELEMENT: TreeMap
// TAIL_TEXT: "<K, V> (java.util)"
@@ -1 +1 @@
ArrayList
TreeMap
@@ -1 +1 @@
import java.util.ArrayList
import java.util.TreeMap
@@ -1 +1 @@
ArrayLis<caret>
TreeM<caret>
+1 -1
View File
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
// comment
+1 -1
View File
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.util.*
+1 -1
View File
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
// comment
fun foo() {}
@@ -1,6 +1,6 @@
import java.util.*
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
// comment
fun foo() {}
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import dependency.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import dependency.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import dependency.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import dependency.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import dependency.AClass.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import dependency.AClass.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import dependency.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import dependency.*
+1 -1
View File
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.sql.*
+3 -3
View File
@@ -1,13 +1,13 @@
// IMPORT: java.util.HashMap
// IMPORT: java.util.Calendar
package p
import java.sql.*
import java.util.ArrayList // maybe dropped on adding import with *
import java.util.Properties // maybe dropped on adding import with *
import java.util.Date // should not be dropped because of conflicting java.sql.Date class
import java.util.HashSet as JavaHashSet // alias import should not be dropped
fun foo() {
val v1 = JavaHashSet()
val v2 = Date()
val v3 = ArrayList()
val v3 = Properties()
}
+2 -2
View File
@@ -1,4 +1,4 @@
// IMPORT: java.util.HashMap
// IMPORT: java.util.Calendar
package p
import java.sql.*
@@ -9,5 +9,5 @@ import java.util.HashSet as JavaHashSet // alias import should not be dropped
fun foo() {
val v1 = JavaHashSet()
val v2 = Date()
val v3 = ArrayList()
val v3 = Properties()
}
+1 -1
View File
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
fun foo() {}
+1 -1
View File
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import java.util.*
@@ -1,3 +1,3 @@
package pack1
fun ArrayList(){}
fun ConcurrentHashMap(){}
+4 -4
View File
@@ -1,7 +1,7 @@
// IMPORT: java.util.ArrayList
import pack1.ArrayList
// IMPORT: java.util.concurrent.ConcurrentHashMap
import pack1.ConcurrentHashMap
fun foo() {
ArrayList()
ArrayList<String>()
ConcurrentHashMap()
ConcurrentHashMap<String, String>()
}
@@ -1,8 +1,8 @@
// IMPORT: java.util.ArrayList
import pack1.ArrayList
import java.util.*
// IMPORT: java.util.concurrent.ConcurrentHashMap
import pack1.ConcurrentHashMap
import java.util.concurrent.*
fun foo() {
ArrayList()
ArrayList<String>()
ConcurrentHashMap()
ConcurrentHashMap<String, String>()
}
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import dependency.*
@@ -1,4 +1,4 @@
// IMPORT: java.util.ArrayList
// IMPORT: java.util.Calendar
package p
import dependency.*
+2 -2
View File
@@ -1,3 +1,3 @@
import java.util.*
import java.util.concurrent.*
val c = Comparator {(x: Int, y: Int) -> 1}
val c = Callable { -> 1 }
@@ -1,3 +1,3 @@
import java.util.Comparator
import java.util.concurrent.Callable
val c = Comparator {(x: Int, y: Int) -> 1}
val c = Callable { -> 1 }
+1 -1
View File
@@ -1,3 +1,3 @@
class A {
val x = <selection>java.util.HashMap<java.util.ArrayList<java.io.File>, String>()</selection>
val x = <selection>java.util.TreeMap<kotlin.collections.List<java.io.File>, String>()</selection>
}
+2 -3
View File
@@ -1,7 +1,6 @@
import java.io.File
import java.util.ArrayList
import java.util.HashMap
import java.util.TreeMap
class A {
val x = HashMap<ArrayList<File>, String>()
val x = TreeMap<List<File>, String>()
}
@@ -1,9 +1,8 @@
import java.util.Collections
import java.util.ArrayList
import java.util.concurrent.Executors
fun foo() {
Collections.sort(
ArrayList<Int>(),
<selection>java.util.Comparator</selection> { x: Int, y: Int -> x - y }
Executors.callable(
<selection>java.lang.Runnable</selection> { -> },
Unit
)
}
@@ -1,10 +1,8 @@
import java.util.Collections
import java.util.ArrayList
import java.util.Comparator
import java.util.concurrent.Executors
fun foo() {
Collections.sort(
ArrayList<Int>(),
Comparator { x: Int, y: Int -> x - y }
Executors.callable(
Runnable { -> },
Unit
)
}
@@ -1 +1 @@
val x = <selection>java.util.HashMap</selection><java.util.Date, String>(1)
val x = <selection>java.util.TreeMap</selection><java.util.Date, String>(1)
@@ -1,3 +1,3 @@
import java.util.HashMap
import java.util.TreeMap
val x = HashMap<java.util.Date, String>(1)
val x = TreeMap<java.util.Date, String>(1)