fixes after review

Original commit: 9869fc4305
This commit is contained in:
Ilya Chernikov
2015-11-27 18:01:01 +01:00
parent 7fbef0dcdd
commit 2a0b1188a2
2 changed files with 4 additions and 4 deletions
@@ -137,7 +137,7 @@ public object KotlinCompilerRunner {
internal object getDaemonConnection {
private @Volatile var connection: DaemonConnection? = null
@Synchronized operator fun invoke(environment: CompilerEnvironment, messageCollector: MessageCollector): DaemonConnection? {
@Synchronized operator fun invoke(environment: CompilerEnvironment, messageCollector: MessageCollector): DaemonConnection {
if (connection == null) {
val libPath = CompilerRunnerUtil.getLibPath(environment.kotlinPaths, messageCollector)
val compilerId = CompilerId.makeCompilerId(File(libPath, "kotlin-compiler.jar"))
@@ -159,7 +159,7 @@ public object KotlinCompilerRunner {
return flagFile
}
val daemon = KotlinCompilerClient.connectToCompileService(compilerId, daemonJVMOptions, daemonOptions, DaemonReportingTargets(null, daemonReportMessages), true, true)
connection = DaemonConnection(daemon, daemon?.leaseCompileSession(newFlagFile().absolutePath)?.get() ?:CompileService.NO_SESSION)
connection = DaemonConnection(daemon, daemon?.leaseCompileSession(newFlagFile().absolutePath)?.get() ?: CompileService.NO_SESSION)
}
for (msg in daemonReportMessages) {
@@ -170,7 +170,7 @@ public object KotlinCompilerRunner {
reportTotalAndThreadPerf("Daemon connect", daemonOptions, messageCollector, profiler)
}
return connection
return connection!!
}
}
@@ -88,7 +88,7 @@ public class SimpleKotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() {
// copied from CompilerDaemonTest.kt
// TODO: find shared place for this function
// java.util.logger used in the daemon silently forgets to log into a file specified in the config on Windows,
// java.util.Logger used in the daemon silently forgets to log into a file specified in the config on Windows,
// if file path is given in windows form (using backslash as a separator); the reason is unknown
// this function makes a path with forward slashed, that works on windows too
internal val File.loggerCompatiblePath: String