diff --git a/src/main/scala/org/scalastyle/Message.scala b/src/main/scala/org/scalastyle/Message.scala index 33ea383b..54dedd14 100644 --- a/src/main/scala/org/scalastyle/Message.scala +++ b/src/main/scala/org/scalastyle/Message.scala @@ -37,7 +37,7 @@ class MessageHelper(config: Config) { def label(key: String): String = getMessage(key + ".label", List()) def description(key: String): String = getMessage(key + ".description", List()) - private[this] def getMessage(key: String, args: List[String]) = { + private[this] def getMessage(key: String, args: Seq[String]) = { try { val pattern = config.getString(key) MessageFormat.format(pattern, args.map(_.asInstanceOf[AnyRef]): _*) @@ -47,7 +47,7 @@ class MessageHelper(config: Config) { } } - def message(key: String, args: List[String]): String = + def message(key: String, args: Seq[String]): String = // Use ClassLoader of the class from which the message came getMessage(key + ".message", args) } @@ -65,7 +65,7 @@ case class StyleError[+T <: FileSpec]( clazz: Class[_ <: Checker[_]], key: String, level: Level, - args: List[String], + args: Seq[String], lineNumber: Option[Int] = None, column: Option[Int] = None, customMessage: Option[String] = None @@ -84,15 +84,10 @@ case class StyleException[+T <: FileSpec]( ) extends Message[T] sealed abstract class ScalastyleError -case class PositionError(position: Int, args: List[String] = List[String](), errorKey: Option[String] = None) +case class PositionError(position: Int, args: Seq[String] = Nil, errorKey: Option[String] = None) extends ScalastyleError -case class FileError(args: List[String] = List[String](), errorKey: Option[String] = None) +case class FileError(args: Seq[String] = Nil, errorKey: Option[String] = None) extends ScalastyleError +case class LineError(line: Int, args: Seq[String] = Nil, errorKey: Option[String] = None) extends ScalastyleError -case class LineError(line: Int, args: List[String] = List[String](), errorKey: Option[String] = None) +case class ColumnError(line: Int, column: Int, args: Seq[String] = Nil, errorKey: Option[String] = None) extends ScalastyleError -case class ColumnError( - line: Int, - column: Int, - args: List[String] = List[String](), - errorKey: Option[String] = None -) extends ScalastyleError diff --git a/src/main/scala/org/scalastyle/Output.scala b/src/main/scala/org/scalastyle/Output.scala index 904ef86d..8cbabaf9 100755 --- a/src/main/scala/org/scalastyle/Output.scala +++ b/src/main/scala/org/scalastyle/Output.scala @@ -25,7 +25,7 @@ object Output { def findMessage( messageHelper: MessageHelper, key: String, - args: List[String], + args: Seq[String], customMessage: Option[String] ): String = { customMessage match {