Cleanup in compiler modules
This commit is contained in:
+1
-1
@@ -67,7 +67,7 @@ public object SamConversionResolverImpl : SamConversionResolver {
|
||||
}
|
||||
|
||||
private fun findFunctionWithMostSpecificReturnType(supertypes: Set<KotlinType>): SimpleFunctionDescriptor {
|
||||
val candidates = ArrayList<SimpleFunctionDescriptor>(supertypes.size())
|
||||
val candidates = ArrayList<SimpleFunctionDescriptor>(supertypes.size)
|
||||
for (supertype in supertypes) {
|
||||
val abstractMembers = SingleAbstractMethodUtils.getAbstractMembers(supertype)
|
||||
if (!abstractMembers.isEmpty()) {
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ public class JavaAnnotationCallChecker : CallChecker {
|
||||
argument: Map.Entry<ValueParameterDescriptor, ResolvedValueArgument>,
|
||||
diagnostic: DiagnosticFactory0<KtExpression>
|
||||
) {
|
||||
argument.getValue().getArguments().forEach {
|
||||
argument.value.getArguments().forEach {
|
||||
if (it.getArgumentExpression() != null) {
|
||||
context.trace.report(
|
||||
diagnostic.on(
|
||||
|
||||
@@ -24,6 +24,6 @@ public interface JvmVirtualFileFinder : VirtualFileFinder, KotlinClassFinder {
|
||||
public object SERVICE {
|
||||
@JvmStatic
|
||||
public fun getInstance(project: Project): JvmVirtualFileFinder =
|
||||
ServiceManager.getService(project, javaClass<JvmVirtualFileFinderFactory>()).create(GlobalSearchScope.allScope(project))
|
||||
ServiceManager.getService(project, JvmVirtualFileFinderFactory::class.java).create(GlobalSearchScope.allScope(project))
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,6 +26,6 @@ public interface JvmVirtualFileFinderFactory : VirtualFileFinderFactory {
|
||||
public object SERVICE {
|
||||
@JvmStatic
|
||||
public fun getInstance(project: Project): JvmVirtualFileFinderFactory =
|
||||
ServiceManager.getService(project, javaClass<JvmVirtualFileFinderFactory>())
|
||||
ServiceManager.getService(project, JvmVirtualFileFinderFactory::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public class VirtualFileKotlinClass private constructor(
|
||||
override fun toString() = "${javaClass.getSimpleName()}: $file"
|
||||
|
||||
companion object Factory {
|
||||
private val LOG = Logger.getInstance(javaClass<VirtualFileKotlinClass>())
|
||||
private val LOG = Logger.getInstance(VirtualFileKotlinClass::class.java)
|
||||
private val perfCounter = PerformanceCounter.create("Binary class from Kotlin file")
|
||||
|
||||
@Deprecated("Use KotlinBinaryClassCache")
|
||||
|
||||
+2
-2
@@ -38,12 +38,12 @@ public class TraitDefaultMethodCallChecker : CallChecker {
|
||||
|
||||
if (containerDescriptor is JavaClassDescriptor && DescriptorUtils.isInterface(containerDescriptor)) {
|
||||
//is java interface default method called from trait
|
||||
val classifier = DescriptorUtils.getParentOfType(context.scope.ownerDescriptor, javaClass<ClassifierDescriptor>())
|
||||
val classifier = DescriptorUtils.getParentOfType(context.scope.ownerDescriptor, ClassifierDescriptor::class.java)
|
||||
|
||||
if (classifier != null && DescriptorUtils.isInterface(classifier)) {
|
||||
context.trace.report(
|
||||
ErrorsJvm.INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER.on(
|
||||
PsiTreeUtil.getParentOfType(resolvedCall.getCall().getCallElement(), javaClass<KtExpression>())
|
||||
PsiTreeUtil.getParentOfType(resolvedCall.getCall().getCallElement(), KtExpression::class.java)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.resolve.BindingContext
|
||||
public interface AnalysisCompletedHandlerExtension {
|
||||
companion object : ProjectExtensionDescriptor<AnalysisCompletedHandlerExtension>(
|
||||
"org.jetbrains.kotlin.analyzeCompleteHandlerExtension",
|
||||
javaClass<AnalysisCompletedHandlerExtension>()
|
||||
AnalysisCompletedHandlerExtension::class.java
|
||||
)
|
||||
|
||||
public fun analysisCompleted(
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ fun erasedSignaturesEqualIgnoringReturnTypes(subFunction: JvmMethodSignature, su
|
||||
val subParams = subFunction.getValueParameters()
|
||||
val superParams = superFunction.getValueParameters()
|
||||
|
||||
if (subParams.size() != superParams.size()) return false
|
||||
if (subParams.size != superParams.size) return false
|
||||
|
||||
return subParams.zip(superParams).all {
|
||||
p -> val (subParam, superParam) = p
|
||||
|
||||
+4
-4
@@ -59,14 +59,14 @@ public object JavaGenericVarianceViolationTypeChecker : AdditionalTypeChecker {
|
||||
|
||||
val correspondingSubType = TypeCheckingProcedure.findCorrespondingSupertype(expressionTypeWithSmartCast, lowerBound) ?: return
|
||||
|
||||
assert(lowerBound.arguments.size() == upperBound.arguments.size()) {
|
||||
assert(lowerBound.arguments.size == upperBound.arguments.size) {
|
||||
"Different arguments count in flexible bounds: " +
|
||||
"($lowerBound(${lowerBound.arguments.size()})..$upperBound(${upperBound.arguments.size()})"
|
||||
"($lowerBound(${lowerBound.arguments.size})..$upperBound(${upperBound.arguments.size})"
|
||||
}
|
||||
|
||||
assert(lowerBound.arguments.size() == correspondingSubType.arguments.size()) {
|
||||
assert(lowerBound.arguments.size == correspondingSubType.arguments.size) {
|
||||
"Different arguments count in corresponding subtype and supertype: " +
|
||||
"($lowerBound(${lowerBound.arguments.size()})..$correspondingSubType(${correspondingSubType.arguments.size()})"
|
||||
"($lowerBound(${lowerBound.arguments.size})..$correspondingSubType(${correspondingSubType.arguments.size})"
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -169,13 +169,13 @@ class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val l
|
||||
|
||||
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<PropertyDescriptor> {
|
||||
var result: SmartList<PropertyDescriptor>? = null
|
||||
val processedTypes: MutableSet<TypeConstructor>? = if (receiverTypes.size() > 1) HashSet<TypeConstructor>() else null
|
||||
val processedTypes: MutableSet<TypeConstructor>? = if (receiverTypes.size > 1) HashSet<TypeConstructor>() else null
|
||||
for (type in receiverTypes) {
|
||||
result = collectSyntheticPropertiesByName(result, type.constructor, name, processedTypes, location)
|
||||
}
|
||||
return when {
|
||||
result == null -> emptyList()
|
||||
result.size() > 1 -> result.toSet()
|
||||
result.size > 1 -> result.toSet()
|
||||
else -> result
|
||||
}
|
||||
}
|
||||
@@ -304,7 +304,7 @@ class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val l
|
||||
descriptor.setMethod = setMethod
|
||||
|
||||
val classTypeParams = ownerClass.typeConstructor.parameters
|
||||
val typeParameters = ArrayList<TypeParameterDescriptor>(classTypeParams.size())
|
||||
val typeParameters = ArrayList<TypeParameterDescriptor>(classTypeParams.size)
|
||||
val typeSubstitutor = DescriptorSubstitutor.substituteTypeParameters(classTypeParams, TypeSubstitution.EMPTY, descriptor, typeParameters)
|
||||
|
||||
val propertyType = typeSubstitutor.safeSubstitute(type, Variance.INVARIANT)
|
||||
|
||||
+2
-2
@@ -67,7 +67,7 @@ class SamAdapterFunctionsScope(storageManager: StorageManager) : SyntheticScope
|
||||
}
|
||||
return when {
|
||||
result == null -> emptyList()
|
||||
result.size() > 1 -> result.toSet()
|
||||
result.size > 1 -> result.toSet()
|
||||
else -> result
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ class SamAdapterFunctionsScope(storageManager: StorageManager) : SyntheticScope
|
||||
}
|
||||
//TODO: duplicated parameter names
|
||||
|
||||
val typeParameters = ArrayList<TypeParameterDescriptor>(sourceTypeParams.size())
|
||||
val typeParameters = ArrayList<TypeParameterDescriptor>(sourceTypeParams.size)
|
||||
val typeSubstitutor = DescriptorSubstitutor.substituteTypeParameters(sourceTypeParams, TypeSubstitution.EMPTY, descriptor, typeParameters)
|
||||
|
||||
descriptor.toSourceFunctionTypeParameters = typeParameters.zip(sourceTypeParams).toMap()
|
||||
|
||||
Reference in New Issue
Block a user