[light classes] LightClassBuilder: cleanup code
^KT-48773
This commit is contained in:
@@ -62,12 +62,10 @@ fun buildLightClass(
|
|||||||
|
|
||||||
stubComputationTrackerInstance(project)?.onStubComputed(javaFileStub, context)
|
stubComputationTrackerInstance(project)?.onStubComputed(javaFileStub, context)
|
||||||
return LightClassBuilderResult(javaFileStub, context.bindingContext, state.collectedExtraJvmDiagnostics)
|
return LightClassBuilderResult(javaFileStub, context.bindingContext, state.collectedExtraJvmDiagnostics)
|
||||||
}
|
} catch (e: ProcessCanceledException) {
|
||||||
catch (e: ProcessCanceledException) {
|
|
||||||
throw e
|
throw e
|
||||||
}
|
} catch (e: RuntimeException) {
|
||||||
catch (e: RuntimeException) {
|
logErrorWithOSInfo(e, packageFqName, files.firstOrNull()?.virtualFile)
|
||||||
logErrorWithOSInfo(e, packageFqName, null)
|
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,11 +91,11 @@ private fun createJavaFileStub(packageFqName: FqName, files: Collection<KtFile>)
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun logErrorWithOSInfo(cause: Throwable?, fqName: FqName, virtualFile: VirtualFile?) {
|
private fun logErrorWithOSInfo(cause: Throwable?, fqName: FqName, virtualFile: VirtualFile?) {
|
||||||
val path = if (virtualFile == null) "<null>" else virtualFile.path
|
val path = virtualFile?.path ?: "<null>"
|
||||||
LOG.error(
|
LOG.error(
|
||||||
"Could not generate LightClass for $fqName declared in $path\n" +
|
"Could not generate LightClass for $fqName declared in $path\n" +
|
||||||
"System: ${SystemInfo.OS_NAME} ${SystemInfo.OS_VERSION} Java Runtime: ${SystemInfo.JAVA_RUNTIME_VERSION}",
|
"System: ${SystemInfo.OS_NAME} ${SystemInfo.OS_VERSION} Java Runtime: ${SystemInfo.JAVA_RUNTIME_VERSION}",
|
||||||
cause
|
cause,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user