Cleanup leftovers in compiler and IDE
This commit is contained in:
@@ -56,7 +56,7 @@ class LazyClasspathWatcher(classpath: Iterable<String>,
|
|||||||
init {
|
init {
|
||||||
// locking before entering thread in order to avoid racing with isChanged
|
// locking before entering thread in order to avoid racing with isChanged
|
||||||
fileIdsLock.acquire()
|
fileIdsLock.acquire()
|
||||||
thread(daemon = true, start = true) {
|
thread(isDaemon = true, start = true) {
|
||||||
try {
|
try {
|
||||||
fileIds = classpath
|
fileIds = classpath
|
||||||
.map { File(it) }
|
.map { File(it) }
|
||||||
|
|||||||
+1
-1
@@ -88,7 +88,7 @@ private fun needExplicitParameterTypes(context: InsertionContext, placeholderRan
|
|||||||
if (functionTypes.size <= 1) return false
|
if (functionTypes.size <= 1) return false
|
||||||
|
|
||||||
val lambdaParameterCount = KotlinBuiltIns.getParameterTypeProjectionsFromFunctionType(lambdaType).size
|
val lambdaParameterCount = KotlinBuiltIns.getParameterTypeProjectionsFromFunctionType(lambdaType).size
|
||||||
return functionTypes.filter { KotlinBuiltIns.getParameterTypeProjectionsFromFunctionType(it).size() == lambdaParameterCount }.size > 1
|
return functionTypes.filter { KotlinBuiltIns.getParameterTypeProjectionsFromFunctionType(it).size == lambdaParameterCount }.size > 1
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun buildTemplate(lambdaType: KotlinType, explicitParameterTypes: Boolean, project: Project): Template {
|
private fun buildTemplate(lambdaType: KotlinType, explicitParameterTypes: Boolean, project: Project): Template {
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class RedundantSamConstructorInspection : AbstractKotlinInspection() {
|
|||||||
|
|
||||||
val samConstructorCalls = samConstructorCallsToBeConverted(expression)
|
val samConstructorCalls = samConstructorCallsToBeConverted(expression)
|
||||||
if (samConstructorCalls.isEmpty()) return
|
if (samConstructorCalls.isEmpty()) return
|
||||||
if (samConstructorCalls.size() == 1) {
|
if (samConstructorCalls.size == 1) {
|
||||||
val single = samConstructorCalls.single()
|
val single = samConstructorCalls.single()
|
||||||
val problemDescriptor = holder.manager.
|
val problemDescriptor = holder.manager.
|
||||||
createProblemDescriptor(single.calleeExpression!!,
|
createProblemDescriptor(single.calleeExpression!!,
|
||||||
@@ -177,7 +177,7 @@ class RedundantSamConstructorInspection : AbstractKotlinInspection() {
|
|||||||
// SAM adapters for static functions
|
// SAM adapters for static functions
|
||||||
for (staticFunWithSameName in containingClass.staticScope.getContributedFunctions(functionResolvedCall.resultingDescriptor.name, NoLookupLocation.FROM_IDE)) {
|
for (staticFunWithSameName in containingClass.staticScope.getContributedFunctions(functionResolvedCall.resultingDescriptor.name, NoLookupLocation.FROM_IDE)) {
|
||||||
if (staticFunWithSameName is SamAdapterDescriptor<*>) {
|
if (staticFunWithSameName is SamAdapterDescriptor<*>) {
|
||||||
if (isSamAdapterSuitableForCall(staticFunWithSameName, originalFunctionDescriptor, samConstructorCallArguments.size())) {
|
if (isSamAdapterSuitableForCall(staticFunWithSameName, originalFunctionDescriptor, samConstructorCallArguments.size)) {
|
||||||
return samConstructorCallArguments.check { canBeReplaced(functionCall, it) } ?: emptyList()
|
return samConstructorCallArguments.check { canBeReplaced(functionCall, it) } ?: emptyList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -191,7 +191,7 @@ class RedundantSamConstructorInspection : AbstractKotlinInspection() {
|
|||||||
NoLookupLocation.FROM_IDE)
|
NoLookupLocation.FROM_IDE)
|
||||||
for (syntheticExtension in syntheticExtensions) {
|
for (syntheticExtension in syntheticExtensions) {
|
||||||
val samAdapter = syntheticExtension as? SamAdapterExtensionFunctionDescriptor ?: continue
|
val samAdapter = syntheticExtension as? SamAdapterExtensionFunctionDescriptor ?: continue
|
||||||
if (isSamAdapterSuitableForCall(samAdapter, originalFunctionDescriptor, samConstructorCallArguments.size())) {
|
if (isSamAdapterSuitableForCall(samAdapter, originalFunctionDescriptor, samConstructorCallArguments.size)) {
|
||||||
return samConstructorCallArguments.check { canBeReplaced(functionCall, it) } ?: emptyList()
|
return samConstructorCallArguments.check { canBeReplaced(functionCall, it) } ?: emptyList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user