From 939bacc81067618bf5e201e2b4782e4a3f2b94d9 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Wed, 28 Jun 2017 13:03:00 +0300 Subject: [PATCH] Minor. Drop unused parameters in LazyJavaScope --- .../java/lazy/descriptors/LazyJavaClassMemberScope.kt | 2 +- .../kotlin/load/java/lazy/descriptors/LazyJavaScope.kt | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt index 4cad381e9ee..b5c8efd79b7 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt @@ -425,7 +425,7 @@ class LazyJavaClassMemberScope( val getter = DescriptorFactory.createDefaultGetter(propertyDescriptor, Annotations.EMPTY) propertyDescriptor.initialize(getter, null) - val returnType = givenType ?: computeMethodReturnType(method, annotations, c.childForMethod(propertyDescriptor, method)) + val returnType = givenType ?: computeMethodReturnType(method, c.childForMethod(propertyDescriptor, method)) propertyDescriptor.setType(returnType, listOf(), getDispatchReceiverParameter(), null as KotlinType?) getter.initialize(returnType) diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt index 6895c9e6d45..691f799ea5f 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt @@ -17,7 +17,6 @@ package org.jetbrains.kotlin.load.java.lazy.descriptors import org.jetbrains.kotlin.descriptors.* -import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.descriptors.impl.PropertyDescriptorImpl import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl import org.jetbrains.kotlin.incremental.components.LookupLocation @@ -119,7 +118,7 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS val methodTypeParameters = method.typeParameters.map { p -> c.typeParameterResolver.resolveTypeParameter(p)!! } val valueParameters = resolveValueParameters(c, functionDescriptorImpl, method.valueParameters) - val returnType = computeMethodReturnType(method, annotations, c) + val returnType = computeMethodReturnType(method, c) val effectiveSignature = resolveMethodSignature(method, methodTypeParameters, returnType, valueParameters.descriptors) @@ -146,7 +145,7 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS return functionDescriptorImpl } - protected fun computeMethodReturnType(method: JavaMethod, annotations: Annotations, c: LazyJavaResolverContext): KotlinType { + protected fun computeMethodReturnType(method: JavaMethod, c: LazyJavaResolverContext): KotlinType { val annotationMethod = method.containingClass.isAnnotationType val returnTypeAttrs = LazyJavaTypeAttributes( TypeUsage.COMMON, @@ -253,7 +252,7 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS val propertyDescriptor = createPropertyDescriptor(field) propertyDescriptor.initialize(null, null) - val propertyType = getPropertyType(field, propertyDescriptor.annotations) + val propertyType = getPropertyType(field) propertyDescriptor.setType(propertyType, listOf(), getDispatchReceiverParameter(), null as KotlinType?) @@ -282,7 +281,7 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS private val JavaField.isFinalStatic: Boolean get() = isFinal && isStatic - private fun getPropertyType(field: JavaField, annotations: Annotations): KotlinType { + private fun getPropertyType(field: JavaField): KotlinType { // Fields do not have their own generic parameters. // Simple static constants should not have flexible types. val isNotNullable = !(field.isFinalStatic && field.hasConstantNotNullInitializer)