Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
pan3793 committed Sep 4, 2024
1 parent 155ac06 commit 448aa76
Show file tree
Hide file tree
Showing 48 changed files with 68 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ object Utilities extends LogLike {
}

implicit def KernelMessageToZMQMessage(kernelMessage : KernelMessage) : ZMQMessage = {
val frames: mutable.ListBuffer[ByteString] = scala.collection.mutable.ListBuffer()
val frames: mutable.ListBuffer[ByteString] = mutable.ListBuffer()
kernelMessage.ids.map((id: Array[Byte]) => frames += ByteString.apply(id))
frames += "<IDS|MSG>"
frames += kernelMessage.signature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class CoursierDependencyDownloader extends DependencyDownloader {
artifactClassifier.map(c => Classifier(c)).getOrElse(Classifier.empty)
)
}
))
).toSeq)

printStream.println(s"Marking $groupId:$artifactId:$version for download")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ abstract class DependencyDownloader {
transitive: Boolean = true,
excludeBaseDependencies: Boolean = true,
ignoreResolutionErrors: Boolean = true,
extraRepositories: collection.Seq[(URL, Option[Credentials])] = Nil,
extraRepositories: Seq[(URL, Option[Credentials])] = Nil,
verbose: Boolean = false,
trace: Boolean = false,
configuration: Option[String] = None,
artifactType: Option[String] = None,
artifactClassifier: Option[String] = None,
excludes: collection.Set[(String,String)] = collection.Set.empty
): collection.Seq[URI]
excludes: Set[(String,String)] = Set.empty
): Seq[URI]

/**
* Sets the printstream to log to.
Expand Down Expand Up @@ -89,7 +89,7 @@ abstract class DependencyDownloader {
*
* @return The list of repositories as URIs
*/
def getRepositories: collection.Seq[URI]
def getRepositories: Seq[URI]

/**
* Sets the directory where all downloaded jars will be stored.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ class IvyDependencyDownloader(
transitive: Boolean = true,
excludeBaseDependencies: Boolean,
ignoreResolutionErrors: Boolean,
extraRepositories: collection.Seq[(URL, Option[Credentials])] = Nil,
extraRepositories: Seq[(URL, Option[Credentials])] = Nil,
verbose: Boolean,
trace: Boolean,
configuration: Option[String] = None,
artifactType: Option[String] = None,
artifactClassifier: Option[String] = None,
excludes: collection.Set[(String,String)] = collection.Set.empty
): collection.Seq[URI] = {
excludes: Set[(String,String)] = Set.empty
): Seq[URI] = {
// Start building the ivy.xml file
val ivyFile = File.createTempFile("ivy-custom", ".xml")
ivyFile.deleteOnExit()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import scala.language.existentials
* implementations of this class loader
*/
class MultiClassLoader(
private val urls: collection.Seq[URL],
private val classLoaders: collection.Seq[ClassLoader]
private val urls: Seq[URL],
private val classLoaders: Seq[ClassLoader]
) extends URLClassLoader(
classLoaders.flatMap({
case urlClassLoader: URLClassLoader => urlClassLoader.getURLs.toSeq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class CommCloseHandler(
}
}

private def handleParseError(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) = {
private def handleParseError(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]): Unit = {
// TODO: Determine proper response for a parse failure
logger.warn("Parse error for Comm Close! Not responding!")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class CommMsgHandler(
}
}

private def handleParseError(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) = {
private def handleParseError(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]): Unit = {
// TODO: Determine proper response for a parse failure
logger.warn("Parse error for Comm Msg! Not responding!")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class CommOpenHandler(
}
}

private def handleParseError(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) = {
private def handleParseError(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]): Unit = {
// TODO: Determine proper response for a parse failure
logger.warn("Parse error for Comm Open! Not responding!")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class SocketConfigSpec extends AnyFunSpec with Matchers {
val CompleteRequestResults = socketConfigJson.validate[SocketConfig]

CompleteRequestResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: SocketConfig) => valid
) should be (socketConfig)
}
Expand Down
12 changes: 6 additions & 6 deletions plugins/src/main/scala/org/apache/toree/plugins/Plugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,31 +70,31 @@ trait Plugin {
_internalPluginManager

/** Represents all @init methods in the plugin. */
@Internal private[plugins] final lazy val initMethods: collection.Seq[PluginMethod] = {
@Internal private[plugins] final lazy val initMethods: Seq[PluginMethod] = {
allMethods.filter(_.isInit)
}

/** Represents all @destroy methods in the plugin. */
@Internal private[plugins] final lazy val destroyMethods: collection.Seq[PluginMethod] = {
@Internal private[plugins] final lazy val destroyMethods: Seq[PluginMethod] = {
allMethods.filter(_.isDestroy)
}

/** Represents all @event methods in the plugin. */
@Internal private[plugins] final lazy val eventMethods: collection.Seq[PluginMethod] = {
@Internal private[plugins] final lazy val eventMethods: Seq[PluginMethod] = {
allMethods.filter(_.isEvent)
}

/** Represents all @events methods in the plugin. */
@Internal private[plugins] final lazy val eventsMethods: collection.Seq[PluginMethod] = {
@Internal private[plugins] final lazy val eventsMethods: Seq[PluginMethod] = {
allMethods.filter(_.isEvents)
}

/** Represents all public/protected methods contained by this plugin. */
private final lazy val allMethods: collection.Seq[PluginMethod] =
private final lazy val allMethods: Seq[PluginMethod] =
getClass.getMethods.map(PluginMethod.apply(this, _: Method))

/** Represents mapping of event names to associated plugin methods. */
@Internal private[plugins] final lazy val eventMethodMap: Map[String, collection.Seq[PluginMethod]] = {
@Internal private[plugins] final lazy val eventMethodMap: Map[String, Seq[PluginMethod]] = {
val allEventMethods = (eventMethods ++ eventsMethods).distinct
val allEventNames = allEventMethods.flatMap(_.eventNames).distinct
allEventNames.map(name =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class PluginManager(
*
* @return The collection of loaded plugins
*/
def initialize(): collection.Seq[Plugin] = {
def initialize(): Seq[Plugin] = {
val newPlugins = internalPlugins.flatMap(t =>
loadPlugin(t._1, t._2).toOption
).toSeq
Expand All @@ -96,7 +96,7 @@ class PluginManager(
// Search for plugins in our new paths, then add loaded plugins to list
// NOTE: Iterator returned from plugin searcher, so avoid building a
// large collection by performing all tasks together
@volatile var newPlugins = collection.Seq[Plugin]()
@volatile var newPlugins = Seq[Plugin]()
pluginSearcher.search(paths: _*).foreach(ci => {
// Add valid path to class loader
pluginClassLoader.addURL(ci.location.toURI.toURL)
Expand Down Expand Up @@ -162,7 +162,7 @@ class PluginManager(
def initializePlugins(
plugins: Seq[Plugin],
scopedDependencyManager: DependencyManager = DependencyManager.Empty
): collection.Seq[PluginMethodResult] = {
): Seq[PluginMethodResult] = {
val pluginMethods = plugins.flatMap(_.initMethods)
val results = invokePluginMethods(
pluginMethods,
Expand Down Expand Up @@ -199,7 +199,7 @@ class PluginManager(
plugins: Seq[Plugin],
scopedDependencyManager: DependencyManager = DependencyManager.Empty,
destroyOnFailure: Boolean = true
): collection.Seq[PluginMethodResult] = {
): Seq[PluginMethodResult] = {
val pluginMethods = plugins.flatMap(_.destroyMethods)
val results = invokePluginMethods(
pluginMethods,
Expand Down Expand Up @@ -278,7 +278,7 @@ class PluginManager(
def fireEvent(
eventName: String,
scopedDependencies: Dependency[_ <: AnyRef]*
): collection.Seq[PluginMethodResult] = {
): Seq[PluginMethodResult] = {
val dependencyManager = new DependencyManager
scopedDependencies.foreach(d => dependencyManager.add(d))
fireEvent(eventName, dependencyManager)
Expand All @@ -295,7 +295,7 @@ class PluginManager(
def fireEvent(
eventName: String,
scopedDependencyManager: DependencyManager = DependencyManager.Empty
): collection.Seq[PluginMethodResult] = {
): Seq[PluginMethodResult] = {
val methods = plugins.flatMap(_.eventMethodMap.getOrElse(eventName, Nil))

invokePluginMethods(methods.toSeq, scopedDependencyManager)
Expand All @@ -313,9 +313,9 @@ class PluginManager(
* @return The collection of results in order of priority
*/
private def invokePluginMethods(
pluginMethods: collection.Seq[PluginMethod],
pluginMethods: Seq[PluginMethod],
scopedDependencyManager: DependencyManager
): collection.Seq[PluginMethodResult] = {
): Seq[PluginMethodResult] = {
// Continue trying to invoke plugins until we finish them all or
// we reach a state where no plugin can be completed
val completedMethods = Array.ofDim[PluginMethodResult](pluginMethods.size)
Expand Down Expand Up @@ -360,7 +360,7 @@ class PluginManager(
* @param pluginMethods The collection of plugin methods to sort
* @return The sorted plugin methods
*/
private def prioritizePluginMethods(pluginMethods: collection.Seq[PluginMethod]) =
private def prioritizePluginMethods(pluginMethods: Seq[PluginMethod]) =
pluginMethods
.groupBy(_.priority)
.flatMap(_._2.sortWith(_.plugin.priority > _.plugin.priority))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ case class PluginMethod(
method: Method
) {
/** Represents the collection of names of events this method supports. */
lazy val eventNames: collection.Seq[String] = {
lazy val eventNames: Seq[String] = {
Option(method.getAnnotation(classOf[Event]))
.map(_.name()).map(Seq(_)).getOrElse(Nil) ++
Option(method.getAnnotation(classOf[Events]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class PluginSearcher {
extraClasses: Map[String, ClassInfo]
): Iterator[ClassInfo] = {
@tailrec def classMatches(
classesToCheck: collection.Seq[ClassInfo]
classesToCheck: Seq[ClassInfo]
): Boolean = {
if (classesToCheck.isEmpty) false
else if (classesToCheck.exists(_.name == ancestor)) true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import org.apache.toree.kernel.protocol.v5.MessageType.MessageType
* .withContentString("content").build
**/
case class KMBuilder(km: KernelMessage = KernelMessage(
ids = Seq(),
ids = Seq.empty.toSeq,
signature = "",
header = HeaderBuilder.empty,
parentHeader = HeaderBuilder.empty,
Expand All @@ -49,7 +49,7 @@ case class KMBuilder(km: KernelMessage = KernelMessage(
require(km != null)

def withIds(newVal: Seq[Array[Byte]]) : KMBuilder =
KMBuilder(this.km.copy(ids = newVal))
KMBuilder(this.km.copy(ids = newVal.toSeq))

def withSignature(newVal: String) : KMBuilder =
KMBuilder(this.km.copy(signature = newVal))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class HeaderSpec extends AnyFunSpec with Matchers {
val headerResults = headerJson.validate[Header]

headerResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: Header) => valid
) should be (header)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ClearOutputSpec extends AnyFunSpec with Matchers {
val CompleteRequestResults = clearOutputJson.validate[ClearOutput]

CompleteRequestResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: ClearOutput) => valid
) should be (clearOutput)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CommCloseSpec extends AnyFunSpec with Matchers {
val CompleteRequestResults = commCloseJson.validate[CommClose]

CompleteRequestResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: CommClose) => valid
) should be (commClose)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class CommMsgSpec extends AnyFunSpec with Matchers {
val CompleteRequestResults = commMsgJson.validate[CommMsg]

CompleteRequestResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: CommMsg) => valid
) should be (commMsg)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CommOpenSpec extends AnyFunSpec with Matchers {
val CompleteRequestResults = commOpenJson.validate[CommOpen]

CompleteRequestResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: CommOpen) => valid
) should be (commOpen)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CompleteReplyErrorSpec extends AnyFunSpec with Matchers {
val CompleteReplyOkResults = completeReplyErrorJson.validate[CompleteReplyError]

CompleteReplyOkResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: CompleteReplyError) => valid
) should be (completeReplyError)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class CompleteReplyOkSpec extends AnyFunSpec with Matchers {
val CompleteReplyOkResults = completeReplyOkJson.validate[CompleteReplyOk]

CompleteReplyOkResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: CompleteReplyOk) => valid
) should be (completeReplyOk)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CompleteReplySpec extends AnyFunSpec with Matchers {
val CompleteReplyResults = completeReplyJson.validate[CompleteReply]

CompleteReplyResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: CompleteReply) => valid
) should be (completeReply)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CompleteRequestSpec extends AnyFunSpec with Matchers {
val CompleteRequestResults = completeRequestJson.validate[CompleteRequest]

CompleteRequestResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: CompleteRequest) => valid
) should be (completeRequest)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ConnectReplySpec extends AnyFunSpec with Matchers {
val ConnectReplyResults = connectReplyJson.validate[ConnectReply]

ConnectReplyResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: ConnectReply) => valid
) should be (connectReply)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ConnectRequestSpec extends AnyFunSpec with Matchers {
val ConnectRequestResults = connectRequestJson.validate[ConnectRequest]

ConnectRequestResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: ConnectRequest) => valid
) should be (connectRequest)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class DisplayDataSpec extends AnyFunSpec with Matchers {
val displayDataResults = displayDataJson.validate[DisplayData]

displayDataResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: DisplayData) => valid
) should be (displayData)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ErrorContentSpec extends AnyFunSpec with Matchers {
val CompleteRequestResults = errorJson.validate[ErrorContent]

CompleteRequestResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: ErrorContent) => valid
) should be (error)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ExecuteInputSpec extends AnyFunSpec with Matchers {
val executeInputResults = executeInputJson.validate[ExecuteInput]

executeInputResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: ExecuteInput) => valid
) should be (executeInput)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ExecuteReplyAbortSpec extends AnyFunSpec with Matchers {
val ExecuteReplyAbortResults = executeReplyAbortJson.validate[ExecuteReplyAbort]

ExecuteReplyAbortResults.fold(
(invalid: collection.Seq[(JsPath, collection.Seq[JsonValidationError])]) => println("Failed!"),
(invalid: Seq[(JsPath, Seq[JsonValidationError])]) => println("Failed!"),
(valid: ExecuteReplyAbort) => valid
) should be (executeReplyAbort)
}
Expand Down
Loading

0 comments on commit 448aa76

Please sign in to comment.