Skip to content

Commit e4e8bee

Browse files
committed
Few warning fixes
1 parent 3b9759b commit e4e8bee

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui/CsvValidatorUi.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ object CsvValidatorUi extends SimpleSwingApplication {
5050
super.startup(args)
5151
}
5252

53-
def top = new SJXFrame {
53+
def top: SJXFrame = new SJXFrame {
5454

5555
title = "CSV Validator"
5656
peer.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)
@@ -71,14 +71,14 @@ object CsvValidatorUi extends SimpleSwingApplication {
7171
}
7272
}
7373

74-
private def getShortVersion(): String = {
74+
private def getShortVersion: String = {
7575
extractFromManifest {
7676
attributes =>
7777
attributes.getValue("Implementation-Version")
7878
}.getOrElse("UNKNOWN")
7979
}
8080

81-
private def getLongVersion(): Seq[(String, String)] = {
81+
private def getLongVersion: Seq[(String, String)] = {
8282
extractFromManifest {
8383
attributes =>
8484
Seq(
@@ -128,7 +128,7 @@ object CsvValidatorUi extends SimpleSwingApplication {
128128

129129
private def validate(csvFilePath: String, csvEncoding: Charset, csvSchemaFilePath: String, csvSchemaEncoding: Charset, failOnFirstError: Boolean, pathSubstitutions: List[(String, String)], enforceCaseSensitivePathChecks: Boolean, progress: Option[ProgressCallback], validateEncoding: Boolean)(output: String => Unit) : Unit = {
130130

131-
def toConsole(msg: String) = Swing.onEDT {
131+
def toConsole(msg: String): Unit = Swing.onEDT {
132132
output(msg)
133133
}
134134

@@ -158,7 +158,7 @@ object CsvValidatorUi extends SimpleSwingApplication {
158158
failOnFirstError,
159159
pathSubstitutions,
160160
enforceCaseSensitivePathChecks,
161-
false,
161+
trace = false,
162162
progress,
163163
rowCallback
164164
)._2 match {
@@ -172,8 +172,8 @@ object CsvValidatorUi extends SimpleSwingApplication {
172172
/**
173173
* Saves a String to a File
174174
*
175-
* @param s
176-
* @param f
175+
* @param s String to save to the file
176+
* @param f File to which the associated string is saved
177177
*/
178178
private def saveToFile(s: String, f: Path) : Option[IOException] = {
179179
val data : Array[Byte] = s.getBytes(UTF_8)
@@ -188,7 +188,7 @@ object CsvValidatorUi extends SimpleSwingApplication {
188188
case class Settings(lastCsvPath: Path, lastCsvSchemaPath: Path, lastReportPath: Path)
189189

190190
lazy val settingsFile : Path = Paths.get(System.getProperty("user.home")).resolve(".csv-validator").resolve("csv-validator.properties")
191-
lazy val userDir = Paths.get(System.getProperty("user.dir"))
191+
lazy val userDir: Path = Paths.get(System.getProperty("user.dir"))
192192

193193
private def loadSettings: Option[Settings] = {
194194
if(Files.exists(settingsFile)) {
@@ -298,7 +298,7 @@ object CsvValidatorUi extends SimpleSwingApplication {
298298

299299
override def update(total: Int, processed: Int) : Unit = {
300300
Swing.onEDT {
301-
progressBar.max = total.toInt
301+
progressBar.max = total
302302
progressBar.value = processed
303303
progressBar.label = s"Line ${processed} of ${total}"
304304
}
@@ -366,11 +366,11 @@ object CsvValidatorUi extends SimpleSwingApplication {
366366
})
367367
}
368368

369-
private val lblVersion = new Label(s"Version: ${getShortVersion()}")
369+
private val lblVersion = new Label(s"Version: ${getShortVersion}")
370370
lblVersion.listenTo(lblVersion.mouse.clicks)
371371
lblVersion.font = lblVersion.font.deriveFont(9)
372372
lblVersion.reactions += onClick {
373-
Dialog.showMessage(this, getLongVersion().map(x => s"${x._1}: ${x._2}").mkString(System.getProperty("line.separator")), "Version Details")
373+
Dialog.showMessage(this, getLongVersion.map(x => s"${x._1}: ${x._2}").mkString(System.getProperty("line.separator")), "Version Details")
374374
}
375375

376376
layout.row.grid(lblCsvFile).add(txtCsvFile, 5).add(btnChooseCsvFile)

0 commit comments

Comments
 (0)