Skip to content

Commit bbab0f1

Browse files
committed
Cleanup: fix some "leaking this" warnings
1 parent 045a23a commit bbab0f1

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

compiler/frontend/src/org/jetbrains/kotlin/psi/KtCodeFragment.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ abstract class KtCodeFragment(
5454
}
5555
}
5656

57+
override final fun init(elementType: IElementType, contentElementType: IElementType?) {
58+
super.init(elementType, contentElementType)
59+
}
60+
5761
private var resolveScope: GlobalSearchScope? = null
5862
private var thisType: PsiType? = null
5963
private var superType: PsiType? = null

compiler/frontend/src/org/jetbrains/kotlin/resolve/importedFromObject.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ fun PropertyDescriptor.asImportedFromObject(original: PropertyImportedFromObject
2727

2828
abstract class ImportedFromObjectCallableDescriptor<out TCallable : CallableMemberDescriptor>(
2929
val callableFromObject: TCallable,
30-
originalOrNull: TCallable?
30+
private val originalOrNull: TCallable?
3131
) : CallableDescriptor {
3232

3333
val containingObject = callableFromObject.containingDeclaration as ClassDescriptor
3434

35-
protected val _original = originalOrNull ?: this
35+
protected val _original
36+
get() = originalOrNull ?: this
3637
}
3738

3839
// members imported from object should be wrapped to not require dispatch receiver

idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/declarationsSearch/declarationSearchUtil.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,13 @@
1717
package org.jetbrains.kotlin.idea.search.declarationsSearch
1818

1919
import com.intellij.psi.search.SearchScope
20-
import com.intellij.util.Query
21-
import com.intellij.util.QueryFactory
22-
import com.intellij.util.Processor
2320
import com.intellij.openapi.application.QueryExecutorBase
2421
import com.intellij.psi.PsiElement
2522
import com.intellij.openapi.project.Project
26-
import com.intellij.util.EmptyQuery
2723
import java.util.Stack
2824
import java.util.HashSet
2925
import com.intellij.openapi.progress.ProgressIndicatorProvider
26+
import com.intellij.util.*
3027
import org.jetbrains.kotlin.psi.psiUtil.contains
3128

3229
interface DeclarationSearchRequest<in T> {
@@ -50,6 +47,10 @@ abstract class DeclarationsSearch<T: PsiElement, R: DeclarationSearchRequest<T>>
5047
)
5148
}
5249

50+
override final fun registerExecutor(executor: QueryExecutor<T, R>) {
51+
super.registerExecutor(executor)
52+
}
53+
5354
protected abstract fun doSearch(request: R, consumer: Processor<T>)
5455
protected open fun isApplicable(request: R): Boolean = true
5556

idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/AbstractIntroduceAction.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ abstract class AbstractIntroduceAction : BasePlatformRefactoringAction() {
2525
setInjectedContext(true)
2626
}
2727

28+
override final fun setInjectedContext(worksInInjected: Boolean) {
29+
super.setInjectedContext(worksInInjected)
30+
}
31+
2832
override fun isAvailableInEditorOnly(): Boolean = true
2933

3034
override fun isEnabledOnElements(elements: Array<out PsiElement>): Boolean =

idea/src/org/jetbrains/kotlin/idea/util/DialogWithEditor.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ open class DialogWithEditor(
4242
setTitle(title)
4343
}
4444

45+
override final fun init() {
46+
super.init()
47+
}
48+
4549
private fun createEditor(): Editor {
4650
val editorFactory = EditorFactory.getInstance()!!
4751
val virtualFile = LightVirtualFile("dummy.kt", KotlinFileType.INSTANCE, initialText)

0 commit comments

Comments
 (0)