Separate additional built-in members from JDK into three groups

- White list: can be used as common built-in declaration
- Black list: can be used only for overrides and super-calls-
- Not considered members: ones that is not in black or white list.
Such members can be used in any context, but they usages marked as deprecated

Third kind is needed to make possible use declarations added in future JDK versions.
Deprecation is necessary because they may get into black list in next Kotlin compiler version
This commit is contained in:
Denis Zharkov
2016-04-28 19:06:12 +03:00
parent 308ee93392
commit e90c92f8d3
24 changed files with 1505 additions and 30 deletions
@@ -330,6 +330,12 @@ public class KotlinTestUtils {
return new File(getHomeDirectory(), "compiler/testData/mockJDK/jre/lib/rt.jar");
}
// Differs from common mock JDK only by one additional 'nonExistingMethod' in Collection and constructor from Double in Throwable
// It's needed to test the way we load additional built-ins members that neither in black nor white lists
public static File findMockJdkRtModified() {
return new File(getHomeDirectory(), "compiler/testData/mockJDKModified/rt.jar");
}
public static File findAndroidApiJar() {
return new File(getHomeDirectory(), "dependencies/android.jar");
}
@@ -438,6 +444,9 @@ public class KotlinTestUtils {
if (jdkKind == TestJdkKind.MOCK_JDK) {
JvmContentRootsKt.addJvmClasspathRoot(configuration, findMockJdkRtJar());
}
else if (jdkKind == TestJdkKind.MODIFIED_MOCK_JDK) {
JvmContentRootsKt.addJvmClasspathRoot(configuration, findMockJdkRtModified());
}
else if (jdkKind == TestJdkKind.ANDROID_API) {
JvmContentRootsKt.addJvmClasspathRoot(configuration, findAndroidApiJar());
}
@@ -18,6 +18,9 @@ package org.jetbrains.kotlin.test;
public enum TestJdkKind {
MOCK_JDK,
// Differs from common mock JDK only by one additional 'nonExistingMethod' in Collection and constructor from Double in Throwable
// It's needed to test the way we load additional built-ins members that neither in black nor white lists
MODIFIED_MOCK_JDK,
FULL_JDK,
ANDROID_API,
}