minor: Make term "canceled" uniformly spelled in identifiers and strings in the daemon

This commit is contained in:
Ilya Chernikov
2016-04-25 21:47:08 +02:00
parent 1614aca48e
commit 22283be1b7
5 changed files with 13 additions and 13 deletions
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.daemon.client
import com.intellij.openapi.progress.ProcessCanceledException import com.intellij.openapi.progress.ProcessCanceledException
import org.jetbrains.kotlin.daemon.common.CompilerCallbackServicesFacade import org.jetbrains.kotlin.daemon.common.CompilerCallbackServicesFacade
import org.jetbrains.kotlin.daemon.common.LoopbackNetworkInterface import org.jetbrains.kotlin.daemon.common.LoopbackNetworkInterface
import org.jetbrains.kotlin.daemon.common.RmiFriendlyCompilationCancelledException import org.jetbrains.kotlin.daemon.common.RmiFriendlyCompilationCanceledException
import org.jetbrains.kotlin.daemon.common.SOCKET_ANY_FREE_PORT import org.jetbrains.kotlin.daemon.common.SOCKET_ANY_FREE_PORT
import org.jetbrains.kotlin.incremental.components.LookupInfo import org.jetbrains.kotlin.incremental.components.LookupInfo
import org.jetbrains.kotlin.incremental.components.LookupTracker import org.jetbrains.kotlin.incremental.components.LookupTracker
@@ -32,7 +32,7 @@ import java.rmi.server.UnicastRemoteObject
class CompilerCallbackServicesFacadeServer( class CompilerCallbackServicesFacadeServer(
val incrementalCompilationComponents: IncrementalCompilationComponents? = null, val incrementalCompilationComponents: IncrementalCompilationComponents? = null,
val compilationCancelledStatus: CompilationCanceledStatus? = null, val compilationCanceledStatus: CompilationCanceledStatus? = null,
port: Int = SOCKET_ANY_FREE_PORT port: Int = SOCKET_ANY_FREE_PORT
) : CompilerCallbackServicesFacade, ) : CompilerCallbackServicesFacade,
UnicastRemoteObject(port, LoopbackNetworkInterface.clientLoopbackSocketFactory, LoopbackNetworkInterface.serverLoopbackSocketFactory) UnicastRemoteObject(port, LoopbackNetworkInterface.clientLoopbackSocketFactory, LoopbackNetworkInterface.serverLoopbackSocketFactory)
@@ -41,7 +41,7 @@ class CompilerCallbackServicesFacadeServer(
override fun hasLookupTracker(): Boolean = incrementalCompilationComponents != null override fun hasLookupTracker(): Boolean = incrementalCompilationComponents != null
override fun hasCompilationCanceledStatus(): Boolean = compilationCancelledStatus != null override fun hasCompilationCanceledStatus(): Boolean = compilationCanceledStatus != null
// TODO: consider replacing NPE with other reporting, although NPE here means most probably incorrect usage // TODO: consider replacing NPE with other reporting, although NPE here means most probably incorrect usage
@@ -83,12 +83,12 @@ class CompilerCallbackServicesFacadeServer(
override fun compilationCanceledStatus_checkCanceled() { override fun compilationCanceledStatus_checkCanceled() {
try { try {
compilationCancelledStatus!!.checkCanceled() compilationCanceledStatus!!.checkCanceled()
} }
catch (e: ProcessCanceledException) { catch (e: ProcessCanceledException) {
// avoid passing exceptions that may have different serialVersionUID on across rmi border // avoid passing exceptions that may have different serialVersionUID on across rmi border
// TODO: doublecheck whether we need to distinguish different cancellation exceptions // TODO: doublecheck whether we need to distinguish different cancellation exceptions
throw RmiFriendlyCompilationCancelledException() throw RmiFriendlyCompilationCanceledException()
} }
} }
} }
@@ -140,7 +140,7 @@ object KotlinCompilerClient {
targetPlatform, targetPlatform,
args, args,
CompilerCallbackServicesFacadeServer(incrementalCompilationComponents = callbackServices.incrementalCompilationComponents, CompilerCallbackServicesFacadeServer(incrementalCompilationComponents = callbackServices.incrementalCompilationComponents,
compilationCancelledStatus = callbackServices.compilationCanceledStatus, compilationCanceledStatus = callbackServices.compilationCanceledStatus,
port = port), port = port),
RemoteOutputStreamServer(compilerOut, port), RemoteOutputStreamServer(compilerOut, port),
CompileService.OutputFormat.XML, CompileService.OutputFormat.XML,
@@ -82,12 +82,12 @@ interface CompilerCallbackServicesFacade : Remote {
// ---------------------------------------------------- // ----------------------------------------------------
// CompilationCanceledStatus // CompilationCanceledStatus
@Throws(RemoteException::class, RmiFriendlyCompilationCancelledException::class) @Throws(RemoteException::class, RmiFriendlyCompilationCanceledException::class)
fun compilationCanceledStatus_checkCanceled(): Unit fun compilationCanceledStatus_checkCanceled(): Unit
} }
class RmiFriendlyCompilationCancelledException: Exception(), Serializable { class RmiFriendlyCompilationCanceledException : Exception(), Serializable {
companion object { companion object {
private val serialVersionUID: Long = 8228357578L // just a random number, but should never be changed to avoid deserialization problems private val serialVersionUID: Long = 8228357578L // just a random number, but should never be changed to avoid deserialization problems
} }
@@ -20,7 +20,7 @@ import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import org.jetbrains.kotlin.daemon.common.CompilerCallbackServicesFacade import org.jetbrains.kotlin.daemon.common.CompilerCallbackServicesFacade
import org.jetbrains.kotlin.daemon.common.DummyProfiler import org.jetbrains.kotlin.daemon.common.DummyProfiler
import org.jetbrains.kotlin.daemon.common.Profiler import org.jetbrains.kotlin.daemon.common.Profiler
import org.jetbrains.kotlin.daemon.common.RmiFriendlyCompilationCancelledException import org.jetbrains.kotlin.daemon.common.RmiFriendlyCompilationCanceledException
import org.jetbrains.kotlin.progress.CompilationCanceledException import org.jetbrains.kotlin.progress.CompilationCanceledException
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import java.util.logging.Logger import java.util.logging.Logger
@@ -36,7 +36,7 @@ class RemoteCompilationCanceledStatusClient(val facade: CompilerCallbackServices
override fun checkCanceled() { override fun checkCanceled() {
fun cancelOnError(e: Exception) { fun cancelOnError(e: Exception) {
log.warning("error communicating with host, assuming compilation cancelled (${e.message})") log.warning("error communicating with host, assuming compilation canceled (${e.message})")
throw CompilationCanceledException() throw CompilationCanceledException()
} }
@@ -46,7 +46,7 @@ class RemoteCompilationCanceledStatusClient(val facade: CompilerCallbackServices
try { try {
facade.compilationCanceledStatus_checkCanceled() facade.compilationCanceledStatus_checkCanceled()
} }
catch (e: RmiFriendlyCompilationCancelledException) { catch (e: RmiFriendlyCompilationCanceledException) {
throw CompilationCanceledException() throw CompilationCanceledException()
} }
catch (e: java.rmi.ConnectIOException) { catch (e: java.rmi.ConnectIOException) {
@@ -440,7 +440,7 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
val jar = tmpdir.absolutePath + File.separator + "largeKotlinFile.jar" val jar = tmpdir.absolutePath + File.separator + "largeKotlinFile.jar"
var callbackServices: CompilerCallbackServicesFacadeServer? = null var callbackServices: CompilerCallbackServicesFacadeServer? = null
callbackServices = CompilerCallbackServicesFacadeServer(compilationCancelledStatus = object : CompilationCanceledStatus { callbackServices = CompilerCallbackServicesFacadeServer(compilationCanceledStatus = object : CompilationCanceledStatus {
override fun checkCanceled() { override fun checkCanceled() {
thread { thread {
Thread.sleep(10) Thread.sleep(10)
@@ -460,7 +460,7 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
val compilerOutput = strm.toString() val compilerOutput = strm.toString()
assertTrue("Expecting cancelation message in:\n$compilerOutput", compilerOutput.contains("Compilation was canceled")) assertTrue("Expecting cancelation message in:\n$compilerOutput", compilerOutput.contains("Compilation was canceled"))
logFile.assertLogContainsSequence("error communicating with host, assuming compilation cancelled") logFile.assertLogContainsSequence("error communicating with host, assuming compilation canceled")
logFile.delete() logFile.delete()
} }