Skip to content

Commit e5c12e0

Browse files
committed
fixup! fixup! Fix deprecated auto application of () to method invocations
- add coverage comments - replace String.valueOf call with string interpolation - replace mixed string (concat + interpolation) with just string interpolation DAFFODIL-2152
1 parent f7bdbe7 commit e5c12e0

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

daffodil-lib/src/main/scala/org/apache/daffodil/lib/Implicits.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ import org.apache.daffodil.lib.xml.NS
2828
object Implicits {
2929

3030
object ImplicitsSuppressUnusedImportWarning {
31+
// $COVERAGE-OFF$
3132
def apply() = if (scala.math.random().isNaN) Assert.impossible()
33+
// $COVERAGE-ON$
3234
}
3335

3436
/**

daffodil-lib/src/main/scala/org/apache/daffodil/lib/TypedEquality.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ import org.apache.daffodil.lib.exceptions.Assert
3636
package object equality {
3737

3838
def EqualitySuppressUnusedImportWarning() = {
39+
// $COVERAGE-OFF$
3940
if (scala.math.random().isNaN) Assert.impossible()
41+
// $COVERAGE-ON$
4042
}
4143

4244
// Convertible types - strongly typed equality

daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/PropertyGenerator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ import org.apache.daffodil.lib.exceptions.ThrowsSDE
762762
def getGeneratedFilePath(rootDir: String, pkg: String, filename: String): String = {
763763
val outDir = new java.io.File(rootDir + "/" + pkg.split('.').reduceLeft(_ + "/" + _))
764764
outDir.mkdirs()
765-
val outPath = String.valueOf(outDir) + "/" + filename
765+
val outPath = s"$outDir/$filename"
766766
outPath
767767
}
768768

daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/TunableGenerator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ class EnumListTunable(
292292
"Nil"
293293
} else {
294294
val defaultSeq =
295-
trimmedDefault.split("\\s+").map(d => s"${listType}.${d.head.toUpper +: d.tail}")
295+
trimmedDefault.split("\\s+").map(d => s"${listType}.${d.head.toUpper}${d.tail}")
296296
s"""Seq(${defaultSeq.mkString(", ")})"""
297297
}
298298

0 commit comments

Comments
 (0)