j2k: flatten test cases and testData directory structure
Move j2k/test/tests -> j2k/tests, j2k/test/testData -> j2k/testData
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import java.util.*;
|
||||
|
||||
class A<T>{
|
||||
void foo(Collection<String> nonMutableCollection,
|
||||
Collection<String> mutableCollection,
|
||||
Set<T> mutableSet,
|
||||
Map<String, T> mutableMap) {
|
||||
mutableCollection.addAll(nonMutableCollection);
|
||||
mutableSet.add(mutableMap.remove("a"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// ERROR: Type mismatch: inferred type is T? but T was expected
|
||||
import java.util.*
|
||||
|
||||
class A<T> {
|
||||
fun foo(nonMutableCollection: Collection<String>, mutableCollection: MutableCollection<String>, mutableSet: MutableSet<T>, mutableMap: MutableMap<String, T>) {
|
||||
mutableCollection.addAll(nonMutableCollection)
|
||||
mutableSet.add(mutableMap.remove("a"))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import java.util.*;
|
||||
|
||||
class A {
|
||||
void foo(Set<String> set) {
|
||||
bar(set);
|
||||
}
|
||||
|
||||
void bar(Collection<String> collection) {
|
||||
collection.add("a");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import java.util.*
|
||||
|
||||
class A {
|
||||
fun foo(set: MutableSet<String>) {
|
||||
bar(set)
|
||||
}
|
||||
|
||||
fun bar(collection: MutableCollection<String>) {
|
||||
collection.add("a")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import java.util.*;
|
||||
|
||||
class A{
|
||||
Collection<String> createCollection() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
Collection<String> foo() {
|
||||
Collection<String> collection = createCollection();
|
||||
collection.add("a");
|
||||
return collection;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import java.util.*
|
||||
|
||||
class A {
|
||||
fun createCollection(): MutableCollection<String> {
|
||||
return ArrayList()
|
||||
}
|
||||
|
||||
fun foo(): Collection<String> {
|
||||
val collection = createCollection()
|
||||
collection.add("a")
|
||||
return collection
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import java.util.*;
|
||||
|
||||
class A {
|
||||
private Collection<String> collection;
|
||||
|
||||
A() {
|
||||
collection = createCollection();
|
||||
}
|
||||
|
||||
Collection<String> createCollection() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public void foo() {
|
||||
collection.add("1")
|
||||
}
|
||||
|
||||
public Collection<String> getCollection() {
|
||||
return collection;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import java.util.*
|
||||
|
||||
class A {
|
||||
private val collection: MutableCollection<String>
|
||||
|
||||
{
|
||||
collection = createCollection()
|
||||
}
|
||||
|
||||
fun createCollection(): MutableCollection<String> {
|
||||
return ArrayList()
|
||||
}
|
||||
|
||||
public fun foo() {
|
||||
collection.add("1")
|
||||
}
|
||||
|
||||
public fun getCollection(): Collection<String> {
|
||||
return collection
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package javaApi;
|
||||
|
||||
import kotlinApi.KotlinClass;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class C extends KotlinClass {
|
||||
public C(int field) {
|
||||
super(field);
|
||||
}
|
||||
|
||||
public List<Object> foo(Collection<String> mutableCollection, Collection<? extends Integer> nullableCollection) {
|
||||
return super.foo(mutableCollection, nullableCollection);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package javaApi
|
||||
|
||||
import kotlinApi.KotlinClass
|
||||
|
||||
public abstract class C(field: Int) : KotlinClass(field) {
|
||||
|
||||
override fun foo(mutableCollection: MutableCollection<String>, nullableCollection: Collection<out Int>?): MutableList<Any> {
|
||||
return super.foo(mutableCollection, nullableCollection)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import java.util.*;
|
||||
|
||||
class A {
|
||||
void foo(Collection<String> collection) {
|
||||
bar(collection);
|
||||
}
|
||||
|
||||
void bar(Collection<String> collection) {
|
||||
if (collection.size() < 5) {
|
||||
foo(collection);
|
||||
}
|
||||
else {
|
||||
collection.add("a")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import java.util.*
|
||||
|
||||
class A {
|
||||
fun foo(collection: MutableCollection<String>) {
|
||||
bar(collection)
|
||||
}
|
||||
|
||||
fun bar(collection: MutableCollection<String>) {
|
||||
if (collection.size() < 5) {
|
||||
foo(collection)
|
||||
} else {
|
||||
collection.add("a")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user