From e4ed217a3b6c4c3893478bd35b79bcbac8f1d387 Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Thu, 29 Jun 2017 14:30:43 +0200 Subject: [PATCH] Add missing explicit serialVersionUID to the REPL API classes --- .../kotlin/cli/common/repl/ReplApi.kt | 41 +++++++++++++++---- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/repl/ReplApi.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/repl/ReplApi.kt index c3c0f040dd0..1cdcf444495 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/repl/ReplApi.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/repl/ReplApi.kt @@ -58,12 +58,17 @@ interface ReplCheckAction { } sealed class ReplCheckResult : Serializable { - class Ok : ReplCheckResult() + class Ok : ReplCheckResult() { + companion object { private val serialVersionUID: Long = 1L } + } - class Incomplete : ReplCheckResult() + class Incomplete : ReplCheckResult() { + companion object { private val serialVersionUID: Long = 1L } + } class Error(val message: String, val location: CompilerMessageLocation? = null) : ReplCheckResult() { override fun toString(): String = "Error(message = \"$message\")" + companion object { private val serialVersionUID: Long = 1L } } companion object { @@ -84,12 +89,17 @@ sealed class ReplCompileResult : Serializable { val classes: List, val hasResult: Boolean, val classpathAddendum: List, - val type: String?) : ReplCompileResult() + val type: String?) : ReplCompileResult() { + companion object { private val serialVersionUID: Long = 2L } + } - class Incomplete : ReplCompileResult() + class Incomplete : ReplCompileResult() { + companion object { private val serialVersionUID: Long = 1L } + } class Error(val message: String, val location: CompilerMessageLocation? = null) : ReplCompileResult() { override fun toString(): String = "Error(message = \"$message\"" + companion object { private val serialVersionUID: Long = 1L } } companion object { @@ -113,20 +123,33 @@ interface ReplEvalAction { sealed class ReplEvalResult : Serializable { class ValueResult(val value: Any?, val type: String?) : ReplEvalResult() { override fun toString(): String = "$value : $type" + companion object { private val serialVersionUID: Long = 1L } } - class UnitResult : ReplEvalResult() + class UnitResult : ReplEvalResult() { + companion object { private val serialVersionUID: Long = 1L } + } - class Incomplete : ReplEvalResult() + class Incomplete : ReplEvalResult() { + companion object { private val serialVersionUID: Long = 1L } + } - class HistoryMismatch(val lineNo: Int) : ReplEvalResult() + class HistoryMismatch(val lineNo: Int) : ReplEvalResult() { + companion object { private val serialVersionUID: Long = 1L } + } sealed class Error(val message: String) : ReplEvalResult() { - class Runtime(message: String, val cause: Exception? = null) : Error(message) + class Runtime(message: String, val cause: Exception? = null) : Error(message) { + companion object { private val serialVersionUID: Long = 1L } + } - class CompileTime(message: String, val location: CompilerMessageLocation? = null) : Error(message) + class CompileTime(message: String, val location: CompilerMessageLocation? = null) : Error(message) { + companion object { private val serialVersionUID: Long = 1L } + } override fun toString(): String = "${this::class.simpleName}Error(message = \"$message\"" + + companion object { private val serialVersionUID: Long = 1L } } companion object {