From 34a9d9e91d4ba487dc3ba6c86a723c10eb82c8c6 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Tue, 20 May 2014 15:35:37 +0400 Subject: [PATCH] Minor: remove warnings --- .../caches/resolve/KotlinResolveCache.kt | 2 +- .../jet/plugin/references/JetReference.kt | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinResolveCache.kt b/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinResolveCache.kt index 8d5b6e2575c..83294b9f545 100644 --- a/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinResolveCache.kt +++ b/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinResolveCache.kt @@ -281,7 +281,7 @@ private object KotlinResolveDataProvider { private fun analyzeExpressionCodeFragment(resolveSession: ResolveSessionForBodies, codeFragment: JetCodeFragment): BindingContext { val codeFragmentExpression = codeFragment.getContentElement() - if (!(codeFragmentExpression is JetExpression)) return BindingContext.EMPTY + if (codeFragmentExpression !is JetExpression) return BindingContext.EMPTY val contextElement = codeFragment.getContext() if (contextElement !is JetExpression) return BindingContext.EMPTY diff --git a/idea/src/org/jetbrains/jet/plugin/references/JetReference.kt b/idea/src/org/jetbrains/jet/plugin/references/JetReference.kt index 26280051dc2..8e882e303ec 100644 --- a/idea/src/org/jetbrains/jet/plugin/references/JetReference.kt +++ b/idea/src/org/jetbrains/jet/plugin/references/JetReference.kt @@ -1,18 +1,18 @@ /* -* Copyright 2010-2014 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-2014 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. + */ package org.jetbrains.jet.plugin.references @@ -50,7 +50,7 @@ abstract class AbstractJetReference(element: T) : PsiPolyVariantReferenceBase(element), JetReference { val expression: T - get() = getElement()!! + get() = getElement() override fun multiResolve(incompleteCode: Boolean): Array { return PsiElementResolveResult.createResults(resolveToPsiElements()) @@ -133,21 +133,21 @@ abstract class AbstractJetReference(element: T) if (reference !is JetReferenceExpression) { return null } - val labelTarget = context.get(BindingContext.LABEL_TARGET, reference) + val labelTarget = context[BindingContext.LABEL_TARGET, reference] if (labelTarget != null) { return listOf(labelTarget) } - return context.get(BindingContext.AMBIGUOUS_LABEL_TARGET, reference) + return context[BindingContext.AMBIGUOUS_LABEL_TARGET, reference] } } public abstract class JetSimpleReference(expression: T) : AbstractJetReference(expression) { override fun getTargetDescriptors(context: BindingContext): Collection { - val targetDescriptor = context.get(BindingContext.REFERENCE_TARGET, expression) + val targetDescriptor = context[BindingContext.REFERENCE_TARGET, expression] if (targetDescriptor != null) { return listOf(targetDescriptor) } - return context.get(BindingContext.AMBIGUOUS_REFERENCE_TARGET, expression).orEmpty() + return context[BindingContext.AMBIGUOUS_REFERENCE_TARGET, expression].orEmpty() } override fun isReferenceTo(element: PsiElement?): Boolean {