diff --git a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/Context.kt b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/Context.kt index f5c92441219..18936dc60f0 100644 --- a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/Context.kt +++ b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/Context.kt @@ -58,7 +58,7 @@ open class Context(val buffer: StringBuffer = StringBuffer(), private var indent public fun trim(num: Int) { - buffer.delete(buffer.length - num, buffer.length) + buffer.delete(buffer.length() - num, buffer.length()) } public fun fork(newBuffer: StringBuffer = StringBuffer(), diff --git a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/KotlinWriter.kt b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/KotlinWriter.kt index b9ea6ae0868..2e807ed35e6 100644 --- a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/KotlinWriter.kt +++ b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/KotlinWriter.kt @@ -54,7 +54,7 @@ class KotlinStringWriter : KotlinWriter { body.writeln("val $name: $retType") body.incIndent() body.write("get() ") - if (getterBody.size > 1) { + if (getterBody.size() > 1) { body.writeNoIndent("{\n") body.incIndent() for (stmt in getterBody) { diff --git a/plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/AbstractAndroidFindUsagesTest.kt b/plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/AbstractAndroidFindUsagesTest.kt index dc26749172a..37346ae6280 100644 --- a/plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/AbstractAndroidFindUsagesTest.kt +++ b/plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/AbstractAndroidFindUsagesTest.kt @@ -17,6 +17,7 @@ package org.jetbrains.kotlin.android import com.intellij.codeInsight.TargetElementUtilBase +import kotlin.test.* public abstract class AbstractAndroidFindUsagesTest : KotlinAndroidTestCase() { @@ -28,12 +29,11 @@ public abstract class AbstractAndroidFindUsagesTest : KotlinAndroidTestCase() { val virtualFile = f.copyFileToProject(path + getTestName(true) + ".kt", "src/" + getTestName(true) + ".kt"); f.configureFromExistingVirtualFile(virtualFile) - val targetElement = TargetElementUtilBase.findTargetElement(f.getEditor(), TargetElementUtilBase.ELEMENT_NAME_ACCEPTED or TargetElementUtilBase.REFERENCED_ELEMENT_ACCEPTED) + val targetElement = TargetElementUtilBase.findTargetElement( + f.getEditor(), TargetElementUtilBase.ELEMENT_NAME_ACCEPTED or TargetElementUtilBase.REFERENCED_ELEMENT_ACCEPTED) + assertNotNull(targetElement) - kotlin.test.assertNotNull(targetElement) - - val propUsages = f.findUsages(targetElement) - - kotlin.test.assertTrue(propUsages.notEmpty) + val propUsages = f.findUsages(targetElement!!) + assertTrue(propUsages.isNotEmpty()) } } \ No newline at end of file diff --git a/plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/KotlinAndroidTestCase.java b/plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/KotlinAndroidTestCase.java index 656b69048b2..3be7856eed4 100644 --- a/plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/KotlinAndroidTestCase.java +++ b/plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/KotlinAndroidTestCase.java @@ -150,8 +150,8 @@ public abstract class KotlinAndroidTestCase extends KotlinAndroidTestCaseBase { ((StartupManagerImpl) StartupManager.getInstance(getProject())).runPostStartupActivities(); VfsRootAccess.allowRootAccess(JetTestUtils.getHomeDirectory()); - kotlinInternalModeOriginalValue = KotlinInternalMode.OBJECT$.getEnabled(); - KotlinInternalMode.OBJECT$.setEnabled(true); + kotlinInternalModeOriginalValue = KotlinInternalMode.Instance.getEnabled(); + KotlinInternalMode.Instance.setEnabled(true); } protected boolean isToAddSdk() { @@ -233,7 +233,7 @@ public abstract class KotlinAndroidTestCase extends KotlinAndroidTestCaseBase { @Override public void tearDown() throws Exception { - KotlinInternalMode.OBJECT$.setEnabled(kotlinInternalModeOriginalValue); + KotlinInternalMode.Instance.setEnabled(kotlinInternalModeOriginalValue); VfsRootAccess.disallowRootAccess(JetTestUtils.getHomeDirectory()); Set builtInsSources = getProject().getComponent(BuiltInsReferenceResolver.class).getBuiltInsSources();