Skip to content

Commit 80e2907

Browse files
authored
Merge pull request #22 from sjrd/upgrades
Upgrades.
2 parents d69e070 + 9de1b5a commit 80e2907

File tree

5 files changed

+26
-22
lines changed

5 files changed

+26
-22
lines changed

.travis.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ script:
99
scala:
1010
- 2.10.7
1111
- 2.11.12
12-
- 2.12.4
13-
- 2.13.0-M2
12+
- 2.12.6
13+
- 2.13.0-M3
14+
- 2.13.0-M4
1415
jdk:
1516
- oraclejdk8
1617
env:
17-
- SCALAJS_VERSION=0.6.21
18-
- SCALAJS_VERSION=1.0.0-M1
19-
- SCALAJS_VERSION=1.0.0-M2
18+
- SCALAJS_VERSION=0.6.23
19+
- SCALAJS_VERSION=1.0.0-M3
20+
matrix:
21+
exclude:
22+
- scala: 2.10.7
23+
env: SCALAJS_VERSION=1.0.0-M3
24+
- scala: 2.13.0-M4
25+
env: SCALAJS_VERSION=1.0.0-M3
2026

2127
cache:
2228
directories:

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sbtcrossproject.crossProject
22

3-
crossScalaVersions in ThisBuild := Seq("2.12.4", "2.11.12", "2.10.7", "2.13.0-M2")
3+
crossScalaVersions in ThisBuild := Seq("2.12.6", "2.11.12", "2.10.7", "2.13.0-M3", "2.13.0-M4")
44
scalaVersion in ThisBuild := (crossScalaVersions in ThisBuild).value.head
55

66
val commonSettings: Seq[Setting[_]] = Seq(

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.16
1+
sbt.version=0.13.17

project/build.sbt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
val scalaJSVersion =
2-
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.21")
2+
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.23")
33

44
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
5-
6-
{
7-
if (scalaJSVersion != "1.0.0-M1")
8-
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.3.0")
9-
else
10-
Nil
11-
}
5+
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.3.0")
126

137
addSbtPlugin("org.scalastyle" % "scalastyle-sbt-plugin" % "0.8.0")

src/main/scala/java/util/logging/Formatter.scala

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package java.util.logging
22

3+
import java.lang.StringBuilder
4+
35
abstract class Formatter protected () {
46

57
def format(record: LogRecord): String
@@ -17,7 +19,7 @@ abstract class Formatter protected () {
1719
// Instead we'll do simple text replacement, very imperative
1820
var msgAccumulator = new StringBuilder()
1921
var inParam = false
20-
var paramInFlight:StringBuilder = null
22+
var paramInFlight: StringBuilder = null
2123
var substitutionFailure = false // track failure to break the loop
2224
var i = 0
2325

@@ -31,13 +33,13 @@ abstract class Formatter protected () {
3133
paramInFlight = new StringBuilder()
3234
} else if (inParam && currentChar != '}') {
3335
// accumulate the param
34-
paramInFlight += currentChar
36+
paramInFlight.append(currentChar)
3537
} else if (currentChar == '}') {
3638
// end of param, replace placeholder by value if possible
3739
inParam = false
3840
val (failed, replacement) = {
3941
try {
40-
val index = paramInFlight.toInt
42+
val index = paramInFlight.toString().toInt
4143
if (index >= 0 && index < params.length) {
4244
(false, params(index).toString)
4345
} else if (index > 0) {
@@ -55,15 +57,17 @@ abstract class Formatter protected () {
5557

5658
// The JVM will fail if e.g. there are bogus params and would not replace
5759
// any parameter
58-
if (failed) substitutionFailure = failed
59-
else msgAccumulator ++= replacement
60+
if (failed)
61+
substitutionFailure = failed
62+
else
63+
msgAccumulator.append(replacement)
6064
} else {
61-
msgAccumulator += currentChar
65+
msgAccumulator.append(currentChar)
6266
}
6367
}
6468

6569
if (substitutionFailure || inParam) msg
66-
else msgAccumulator.result()
70+
else msgAccumulator.toString()
6771
} else {
6872
msg
6973
}

0 commit comments

Comments
 (0)