Cleanup leftovers in compiler and IDE

This commit is contained in:
Ilya Gorbunov
2015-12-29 18:48:56 +03:00
parent 3d5e415c87
commit 92c2d17910
3 changed files with 5 additions and 5 deletions
@@ -56,7 +56,7 @@ class LazyClasspathWatcher(classpath: Iterable<String>,
init {
// locking before entering thread in order to avoid racing with isChanged
fileIdsLock.acquire()
thread(daemon = true, start = true) {
thread(isDaemon = true, start = true) {
try {
fileIds = classpath
.map { File(it) }
@@ -88,7 +88,7 @@ private fun needExplicitParameterTypes(context: InsertionContext, placeholderRan
if (functionTypes.size <= 1) return false
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 {
@@ -79,7 +79,7 @@ class RedundantSamConstructorInspection : AbstractKotlinInspection() {
val samConstructorCalls = samConstructorCallsToBeConverted(expression)
if (samConstructorCalls.isEmpty()) return
if (samConstructorCalls.size() == 1) {
if (samConstructorCalls.size == 1) {
val single = samConstructorCalls.single()
val problemDescriptor = holder.manager.
createProblemDescriptor(single.calleeExpression!!,
@@ -177,7 +177,7 @@ class RedundantSamConstructorInspection : AbstractKotlinInspection() {
// SAM adapters for static functions
for (staticFunWithSameName in containingClass.staticScope.getContributedFunctions(functionResolvedCall.resultingDescriptor.name, NoLookupLocation.FROM_IDE)) {
if (staticFunWithSameName is SamAdapterDescriptor<*>) {
if (isSamAdapterSuitableForCall(staticFunWithSameName, originalFunctionDescriptor, samConstructorCallArguments.size())) {
if (isSamAdapterSuitableForCall(staticFunWithSameName, originalFunctionDescriptor, samConstructorCallArguments.size)) {
return samConstructorCallArguments.check { canBeReplaced(functionCall, it) } ?: emptyList()
}
}
@@ -191,7 +191,7 @@ class RedundantSamConstructorInspection : AbstractKotlinInspection() {
NoLookupLocation.FROM_IDE)
for (syntheticExtension in syntheticExtensions) {
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()
}
}