Fix compilation for 203
diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreApplicationEnvironment.java b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreApplicationEnvironment.java
index 26562e4..692e099 100644
--- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreApplicationEnvironment.java
+++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreApplicationEnvironment.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.cli.jvm.compiler;
@@ -40,7 +40,7 @@
registerApplicationExtensionPoint(JavaMainMethodProvider.EP_NAME, JavaMainMethodProvider.class);
registerApplicationExtensionPoint(ContainerProvider.EP_NAME, ContainerProvider.class);
- registerApplicationExtensionPoint(ClassFileDecompilers.EP_NAME, ClassFileDecompilers.Decompiler.class);
+ registerApplicationExtensionPoint(ClassFileDecompilers.getInstance().EP_NAME, ClassFileDecompilers.Decompiler.class);
registerApplicationExtensionPoint(MetaLanguage.EP_NAME, MetaLanguage.class);
diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtElementImplStub.java b/compiler/psi/src/org/jetbrains/kotlin/psi/KtElementImplStub.java
index f8dd426..1ccc116 100644
--- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtElementImplStub.java
+++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtElementImplStub.java
@@ -1,17 +1,6 @@
/*
- * Copyright 2010-2015 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.psi;
@@ -113,7 +102,7 @@
}
@NotNull
- protected <PsiT extends KtElementImplStub<?>, StubT extends StubElement> List<PsiT> getStubOrPsiChildrenAsList(
+ protected <PsiT extends KtElementImplStub<?>, StubT extends StubElement<?>> List<PsiT> getStubOrPsiChildrenAsList(
@NotNull KtStubElementType<StubT, PsiT> elementType
) {
return Arrays.asList(getStubOrPsiChildren(elementType, elementType.getArrayFactory()));
diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtAnnotationUseSiteTargetElementType.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtAnnotationUseSiteTargetElementType.kt
index 76725de..49c92c5 100644
--- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtAnnotationUseSiteTargetElementType.kt
+++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtAnnotationUseSiteTargetElementType.kt
@@ -1,17 +1,6 @@
/*
- * Copyright 2010-2015 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.psi.stubs.elements
@@ -30,7 +19,7 @@
debugName, KtAnnotationUseSiteTarget::class.java, KotlinAnnotationUseSiteTargetStub::class.java
) {
- override fun createStub(psi: KtAnnotationUseSiteTarget, parentStub: StubElement<PsiElement>): KotlinAnnotationUseSiteTargetStub {
+ override fun createStub(psi: KtAnnotationUseSiteTarget, parentStub: StubElement<out PsiElement>): KotlinAnnotationUseSiteTargetStub {
val useSiteTarget = psi.getAnnotationUseSiteTarget().name
return KotlinAnnotationUseSiteTargetStubImpl(parentStub, StringRef.fromString(useSiteTarget)!!)
}
diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtImportAliasElementType.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtImportAliasElementType.kt
index 31899b9..5c36303 100644
--- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtImportAliasElementType.kt
+++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtImportAliasElementType.kt
@@ -1,17 +1,6 @@
/*
- * Copyright 2010-2017 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.psi.stubs.elements
@@ -27,7 +16,7 @@
class KtImportAliasElementType(debugName: String) :
KtStubElementType<KotlinImportAliasStub, KtImportAlias>(debugName, KtImportAlias::class.java, KotlinImportAliasStub::class.java) {
- override fun createStub(psi: KtImportAlias, parentStub: StubElement<PsiElement>?): KotlinImportAliasStub {
+ override fun createStub(psi: KtImportAlias, parentStub: StubElement<out PsiElement>?): KotlinImportAliasStub {
return KotlinImportAliasStubImpl(parentStub, StringRef.fromString(psi.name))
}
diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtModifierListElementType.java b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtModifierListElementType.java
index 575d6b2..321d238 100644
--- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtModifierListElementType.java
+++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtModifierListElementType.java
@@ -1,17 +1,6 @@
/*
- * Copyright 2010-2015 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.psi.stubs.elements;
@@ -36,7 +25,7 @@
}
@Override
- public KotlinModifierListStub createStub(@NotNull T psi, StubElement parentStub) {
+ public KotlinModifierListStub createStub(@NotNull T psi, StubElement<?> parentStub) {
return new KotlinModifierListStubImpl(parentStub, computeMaskFromModifierList(psi), this);
}
diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtPlaceHolderStubElementType.java b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtPlaceHolderStubElementType.java
index 386b010..3abeed9 100644
--- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtPlaceHolderStubElementType.java
+++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtPlaceHolderStubElementType.java
@@ -1,17 +1,6 @@
/*
- * Copyright 2010-2015 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.psi.stubs.elements;
@@ -34,7 +23,7 @@
}
@Override
- public KotlinPlaceHolderStub<T> createStub(@NotNull T psi, StubElement parentStub) {
+ public KotlinPlaceHolderStub<T> createStub(@NotNull T psi, StubElement<?> parentStub) {
return new KotlinPlaceHolderStubImpl<>(parentStub, this);
}
diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtScriptElementType.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtScriptElementType.kt
index 7b77230..15c241d 100644
--- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtScriptElementType.kt
+++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtScriptElementType.kt
@@ -1,17 +1,6 @@
/*
- * Copyright 2010-2015 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.psi.stubs.elements
@@ -30,7 +19,7 @@
debugName, KtScript::class.java, KotlinScriptStub::class.java
) {
- override fun createStub(psi: KtScript, parentStub: StubElement<PsiElement>): KotlinScriptStub {
+ override fun createStub(psi: KtScript, parentStub: StubElement<out PsiElement>): KotlinScriptStub {
return KotlinScriptStubImpl(parentStub, StringRef.fromString(psi.fqName.asString()))
}
diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementType.java b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementType.java
index 0a004de..a67feb9 100644
--- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementType.java
+++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementType.java
@@ -1,17 +1,6 @@
/*
- * Copyright 2010-2015 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.psi.stubs.elements;
@@ -36,7 +25,7 @@
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
-public abstract class KtStubElementType<StubT extends StubElement, PsiT extends KtElementImplStub<?>> extends IStubElementType<StubT, PsiT> {
+public abstract class KtStubElementType<StubT extends StubElement<?>, PsiT extends KtElementImplStub<?>> extends IStubElementType<StubT, PsiT> {
@NotNull
private final Constructor<PsiT> byNodeConstructor;
diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtValueArgumentElementType.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtValueArgumentElementType.kt
index 796a181..6bc4529 100644
--- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtValueArgumentElementType.kt
+++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtValueArgumentElementType.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -16,7 +16,7 @@
class KtValueArgumentElementType<T : KtValueArgument>(debugName: String, psiClass: Class<T>) :
KtStubElementType<KotlinValueArgumentStub<T>, T>(debugName, psiClass, KotlinValueArgumentStub::class.java) {
- override fun createStub(psi: T, parentStub: StubElement<PsiElement>?): KotlinValueArgumentStub<T> {
+ override fun createStub(psi: T, parentStub: StubElement<out PsiElement>?): KotlinValueArgumentStub<T> {
return KotlinValueArgumentStubImpl(parentStub, this, psi.isSpread)
}
diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/impl/KotlinImportAliasStubImpl.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/impl/KotlinImportAliasStubImpl.kt
index 637350f..10c5c49 100644
--- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/impl/KotlinImportAliasStubImpl.kt
+++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/impl/KotlinImportAliasStubImpl.kt
@@ -1,17 +1,6 @@
/*
- * Copyright 2010-2017 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.psi.stubs.impl
@@ -24,7 +13,7 @@
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes
class KotlinImportAliasStubImpl(
- parent: StubElement<PsiElement>?,
+ parent: StubElement<out PsiElement>?,
private val name: StringRef?
) : KotlinStubBaseImpl<KtImportAlias>(parent, KtStubElementTypes.IMPORT_ALIAS), KotlinImportAliasStub {
override fun getName(): String? = StringRef.toString(name)
diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/test/testFramework/KtUsefulTestCase.java b/compiler/tests-common/tests/org/jetbrains/kotlin/test/testFramework/KtUsefulTestCase.java
index f04e03d..09cfda9 100644
--- a/compiler/tests-common/tests/org/jetbrains/kotlin/test/testFramework/KtUsefulTestCase.java
+++ b/compiler/tests-common/tests/org/jetbrains/kotlin/test/testFramework/KtUsefulTestCase.java
@@ -1,17 +1,6 @@
/*
- * Copyright 2010-2016 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.test.testFramework;
@@ -505,7 +494,7 @@
/**
* If you want a more shorter name than runInEdtAndWait.
*/
- protected void edt(@NotNull ThrowableRunnable<Throwable> runnable) {
+ protected void edt(@NotNull ThrowableRunnable<Throwable> runnable) throws Throwable {
EdtTestUtil.runInEdtAndWait(runnable);
}
@@ -1148,7 +1137,7 @@
return UIUtil.invokeAndWaitIfNeeded(() -> LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file));
}
- public static void waitForAppLeakingThreads(long timeout, @NotNull TimeUnit timeUnit) {
+ public static void waitForAppLeakingThreads(long timeout, @NotNull TimeUnit timeUnit) throws Exception {
EdtTestUtil.runInEdtAndWait(() -> {
Application app = ApplicationManager.getApplication();
if (app != null && !app.isDisposed()) {
diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KotlinCompletionTestCase.java b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KotlinCompletionTestCase.java
index 279ac63..98e99e4 100644
--- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KotlinCompletionTestCase.java
+++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KotlinCompletionTestCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -9,6 +9,8 @@
import com.intellij.codeInsight.completion.CompletionTestCase;
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
import com.intellij.util.ArrayUtil;
+import com.intellij.util.ThrowableRunnable;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.WithMutedInDatabaseRunTest;
@@ -29,8 +31,7 @@
}
@Override
- protected void runTest() throws Throwable {
- //noinspection Convert2MethodRef
- KotlinTestUtils.runTestWithThrowable(this, () -> super.runTest());
+ protected void runTestRunnable(@NotNull ThrowableRunnable<Throwable> testRunnable) throws Throwable {
+ KotlinTestUtils.runTestWithThrowable(this, () -> super.runTestRunnable(testRunnable));
}
}
diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinCodeInsightTestCase.java b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinCodeInsightTestCase.java
index d30ecbe..652c418 100644
--- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinCodeInsightTestCase.java
+++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinCodeInsightTestCase.java
@@ -1,30 +1,17 @@
/*
- * Copyright 2010-2015 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.test;
import com.intellij.codeInsight.CodeInsightTestCase;
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
-import kotlin.Unit;
+import com.intellij.util.ThrowableRunnable;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.test.KotlinTestUtils;
-import org.jetbrains.kotlin.test.MuteWithDatabaseKt;
import org.jetbrains.kotlin.test.WithMutedInDatabaseRunTest;
-import static org.jetbrains.kotlin.test.MuteWithDatabaseKt.isIgnoredInDatabaseWithLog;
-
/**
* Please use KotlinLightCodeInsightFixtureTestCase as the base class for all new tests.
*/
@@ -44,7 +31,7 @@
}
@Override
- protected void runTest() throws Throwable {
- KotlinTestUtils.runTestWithThrowable(this, () -> super.runTest());
+ protected void runTestRunnable(@NotNull ThrowableRunnable<Throwable> testRunnable) throws Throwable {
+ KotlinTestUtils.runTestWithThrowable(this, () -> super.runTestRunnable(testRunnable));
}
}
diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCaseBase.java b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCaseBase.java
index 0b25e4f..79bf80c 100644
--- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCaseBase.java
+++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCaseBase.java
@@ -13,6 +13,7 @@
import com.intellij.psi.PsiFile;
import com.intellij.testFramework.TempFiles;
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
+import com.intellij.util.ThrowableRunnable;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -25,6 +26,7 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
+import java.nio.file.Path;
import java.util.Collection;
@WithMutedInDatabaseRunTest
@@ -46,7 +48,7 @@
return super.getFile();
}
- protected final Collection<File> myFilesToDelete = new THashSet<>();
+ protected final Collection<Path> myFilesToDelete = new THashSet<>();
private final TempFiles myTempFiles = new TempFiles(myFilesToDelete);
@Override
@@ -65,7 +67,7 @@
File temp = FileUtil.createTempFile("copy", "." + ext);
setContentOnDisk(temp, bom, content, charset);
- myFilesToDelete.add(temp);
+ myFilesToDelete.add(temp.toPath());
final VirtualFile file = getVirtualFile(temp);
assert file != null : temp;
return file;
@@ -87,9 +89,8 @@
}
@Override
- protected void runTest() throws Throwable {
- //noinspection Convert2MethodRef
- KotlinTestUtils.runTestWithThrowable(this, () -> super.runTest());
+ protected void runTestRunnable(@NotNull ThrowableRunnable<Throwable> testRunnable) throws Throwable {
+ KotlinTestUtils.runTestWithThrowable(this, () -> super.runTestRunnable(testRunnable));
}
protected boolean isFirPlugin() {
diff --git a/idea/src/org/jetbrains/kotlin/idea/actions/NewKotlinFileAction.kt b/idea/src/org/jetbrains/kotlin/idea/actions/NewKotlinFileAction.kt
index e366c6c..df7ab31 100644
--- a/idea/src/org/jetbrains/kotlin/idea/actions/NewKotlinFileAction.kt
+++ b/idea/src/org/jetbrains/kotlin/idea/actions/NewKotlinFileAction.kt
@@ -47,7 +47,7 @@
KotlinBundle.message("action.new.file.description"),
KotlinFileType.INSTANCE.icon
), DumbAware {
- override fun postProcess(createdElement: PsiFile?, templateName: String?, customProperties: Map<String, String>?) {
+ override fun postProcess(createdElement: PsiFile, templateName: String?, customProperties: Map<String, String>?) {
super.postProcess(createdElement, templateName, customProperties)
val module = ModuleUtilCore.findModuleForPsiElement(createdElement!!)
diff --git a/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinInTempDirTest.kt b/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinInTempDirTest.kt
index 7c23146..cfcd81c 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinInTempDirTest.kt
+++ b/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinInTempDirTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -15,7 +15,7 @@
override fun getProjectDirOrFile(): Path {
val tempDir = FileUtil.generateRandomTemporaryPath()
FileUtil.createTempDirectory("temp", null)
- myFilesToDelete.add(tempDir)
+ myFilesToDelete.add(tempDir.toPath())
FileUtil.copyDir(File(projectRoot), tempDir)
diff --git a/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt b/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt
index da76e3e..d454e5d 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt
+++ b/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -17,19 +17,18 @@
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess
import com.intellij.testFramework.PlatformTestCase
import com.intellij.testFramework.UsefulTestCase
+import com.intellij.util.ThrowableRunnable
import junit.framework.TestCase
import org.jetbrains.kotlin.idea.configuration.KotlinWithLibraryConfigurator.FileState
import org.jetbrains.kotlin.idea.framework.KotlinSdkType
-import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase.*
-import org.jetbrains.kotlin.idea.util.getProjectJdkTableSafe
import org.jetbrains.kotlin.test.KotlinTestUtils
import org.jetbrains.kotlin.test.WithMutedInDatabaseRunTest
-import org.jetbrains.kotlin.test.isIgnoredInDatabaseWithLog
import org.jetbrains.kotlin.test.runTest
import org.jetbrains.kotlin.utils.PathUtil
import java.io.File
import java.nio.file.Path
+import java.nio.file.Paths
@WithMutedInDatabaseRunTest
abstract class AbstractConfigureKotlinTest : PlatformTestCase() {
@@ -112,7 +111,7 @@
return File(projectFilePath).toPath()
}
- override fun doCreateProject(projectFile: Path): Project {
+ override fun doCreateAndOpenProject(projectFile: Path): Project {
return loadProjectCompat(projectFile)
}
@@ -135,8 +134,8 @@
UsefulTestCase.assertDoesntExist(File(JS_CONFIGURATOR.getDefaultPathToJarFile(project)))
}
- override fun runTest() {
- return runTest { super.runTest() }
+ override fun runTestRunnable(testRunnable: ThrowableRunnable<Throwable>) {
+ return runTest { super.runTestRunnable(testRunnable) }
}
companion object {
@@ -239,14 +238,14 @@
private val pathToNonexistentRuntimeJar: String
get() {
val pathToTempKotlinRuntimeJar = FileUtil.getTempDirectory() + "/" + PathUtil.KOTLIN_JAVA_STDLIB_JAR
- myFilesToDelete.add(File(pathToTempKotlinRuntimeJar))
+ myFilesToDelete.add(Paths.get(pathToTempKotlinRuntimeJar))
return pathToTempKotlinRuntimeJar
}
private val pathToNonexistentJsJar: String
get() {
val pathToTempKotlinRuntimeJar = FileUtil.getTempDirectory() + "/" + PathUtil.JS_LIB_JAR_NAME
- myFilesToDelete.add(File(pathToTempKotlinRuntimeJar))
+ myFilesToDelete.add(Paths.get(pathToTempKotlinRuntimeJar))
return pathToTempKotlinRuntimeJar
}
diff --git a/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocInHierarchyTest.kt b/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocInHierarchyTest.kt
index a7baabe..e4dc40f 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocInHierarchyTest.kt
+++ b/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocInHierarchyTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -39,7 +39,7 @@
val provider = BrowseHierarchyActionBase.findProvider(LanguageTypeHierarchy.INSTANCE, file, file, context)!!
val hierarchyTreeStructure = TypeHierarchyTreeStructure(
project,
- provider.getTarget(context) as PsiClass?,
+ provider.getTarget(context) as PsiClass,
HierarchyBrowserBaseEx.SCOPE_PROJECT
)
val hierarchyNodeDescriptor = hierarchyTreeStructure.baseDescriptor as TypeHierarchyNodeDescriptor
diff --git a/idea/tests/org/jetbrains/kotlin/idea/perf/UltraLightChecker.kt b/idea/tests/org/jetbrains/kotlin/idea/perf/UltraLightChecker.kt
index 52de319..fe05f29 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/perf/UltraLightChecker.kt
+++ b/idea/tests/org/jetbrains/kotlin/idea/perf/UltraLightChecker.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -8,7 +8,6 @@
import com.intellij.openapi.Disposable
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
-import com.intellij.openapi.util.Conditions
import com.intellij.openapi.util.Disposer
import com.intellij.psi.*
import com.intellij.psi.search.GlobalSearchScope
@@ -24,10 +23,7 @@
import org.jetbrains.kotlin.asJava.elements.KtLightPsiArrayInitializerMemberValue
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
-import org.jetbrains.kotlin.idea.caches.resolve.analyze
-import org.jetbrains.kotlin.idea.core.script.ScriptConfigurationManager
import org.jetbrains.kotlin.idea.project.languageVersionSettings
-import org.jetbrains.kotlin.j2k.getContainingClass
import org.jetbrains.kotlin.load.kotlin.NON_EXISTENT_CLASS_NAME
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.psi.KtClassOrObject
@@ -318,7 +314,7 @@
10,
mapOf(element to element.javaClass.name),
Any::class.java,
- Conditions.alwaysTrue(),
+ { true },
PairProcessor { value, backLink ->
if (value is DeclarationDescriptor) {
assertFails {
diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringChangeCollectorTest.kt b/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringChangeCollectorTest.kt
index 5075217..c7b43fe 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringChangeCollectorTest.kt
+++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringChangeCollectorTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -12,11 +12,12 @@
import com.intellij.openapi.fileTypes.FileType
import com.intellij.psi.PsiDocumentManager
import com.intellij.psi.PsiFile
+import com.intellij.refactoring.suggested.BaseSuggestedRefactoringChangeCollectorTest
import com.intellij.refactoring.suggested.SuggestedRefactoringSupport.Parameter
import com.intellij.refactoring.suggested.SuggestedRefactoringSupport.Signature
+import com.intellij.util.ThrowableRunnable
import org.jetbrains.kotlin.idea.KotlinFileType
import org.jetbrains.kotlin.idea.KotlinLanguage
-import com.intellij.refactoring.suggested.BaseSuggestedRefactoringChangeCollectorTest
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.test.runTest
@@ -200,7 +201,7 @@
)
}
- override fun runTest() {
- runTest { super.runTest() }
+ override fun runTestRunnable(testRunnable: ThrowableRunnable<Throwable>) {
+ runTest { super.runTestRunnable(testRunnable) }
}
}
diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringChangeListenerTest.kt b/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringChangeListenerTest.kt
index b6d6da9..8cb593a 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringChangeListenerTest.kt
+++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringChangeListenerTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -10,6 +10,7 @@
import com.intellij.openapi.command.executeCommand
import com.intellij.openapi.fileTypes.FileType
import com.intellij.refactoring.suggested.BaseSuggestedRefactoringChangeListenerTest
+import com.intellij.util.ThrowableRunnable
import org.jetbrains.kotlin.idea.KotlinFileType
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.endOffset
@@ -386,8 +387,8 @@
}
}
- override fun runTest() {
- runTest { super.runTest() }
+ override fun runTestRunnable(testRunnable: ThrowableRunnable<Throwable>) {
+ runTest { super.runTestRunnable(testRunnable) }
}
private fun addImport(fqName: String) {
diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringTest.kt b/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringTest.kt
index 8aaa1da..2112f49 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringTest.kt
+++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -14,6 +14,7 @@
import com.intellij.refactoring.suggested.SuggestedRefactoringExecution
import com.intellij.refactoring.suggested.SuggestedRefactoringProviderImpl
import com.intellij.refactoring.suggested._suggestedChangeSignatureNewParameterValuesForTests
+import com.intellij.util.ThrowableRunnable
import org.jetbrains.kotlin.idea.KotlinFileType
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
import org.jetbrains.kotlin.psi.KtFile
@@ -1574,8 +1575,8 @@
)
}
- override fun runTest() {
- runTest { super.runTest() }
+ override fun runTestRunnable(testRunnable: ThrowableRunnable<Throwable>) {
+ runTest { super.runTestRunnable(testRunnable) }
}
private fun addImport(fqName: String) {
diff --git a/idea/tests/org/jetbrains/kotlin/idea/script/AbstractScriptConfigurationTest.kt b/idea/tests/org/jetbrains/kotlin/idea/script/AbstractScriptConfigurationTest.kt
index 8dba461..833e581 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/script/AbstractScriptConfigurationTest.kt
+++ b/idea/tests/org/jetbrains/kotlin/idea/script/AbstractScriptConfigurationTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -191,7 +191,7 @@
private fun createTestModuleByName(name: String): Module {
val newModuleDir = runWriteAction { VfsUtil.createDirectoryIfMissing(project.baseDir, name) }
- val newModule = createModuleAt(name, project, JavaModuleType.getModuleType(), newModuleDir.path)
+ val newModule = createModuleAt(name, project, JavaModuleType.getModuleType(), VfsUtil.virtualToIoFile(newModuleDir).toPath())
PsiTestUtil.addSourceContentToRoots(newModule, newModuleDir)
return newModule