Merge pull request #15832 from ktoso/port-15828-turkishbug-rkuhn

=act,clu,rem #15828 Turkish I bug (for Validation)
This commit is contained in:
Konrad Malawski 2014-09-09 11:48:06 +02:00
commit 60ab0fb3d0
5 changed files with 12 additions and 7 deletions

View file

@ -21,6 +21,7 @@ import scala.concurrent.duration.{ FiniteDuration, Duration }
import scala.concurrent.{ Await, Future, Promise, ExecutionContext, ExecutionContextExecutor }
import scala.util.{ Failure, Success, Try }
import scala.util.control.{ NonFatal, ControlThrowable }
import java.util.Locale
object ActorSystem {
@ -181,7 +182,7 @@ object ActorSystem {
final val LoggingFilter: String = getString("akka.logging-filter")
final val LoggerStartTimeout: Timeout = Timeout(config.getMillisDuration("akka.logger-startup-timeout"))
final val LogConfigOnStart: Boolean = config.getBoolean("akka.log-config-on-start")
final val LogDeadLetters: Int = config.getString("akka.log-dead-letters").toLowerCase match {
final val LogDeadLetters: Int = config.getString("akka.log-dead-letters").toLowerCase(Locale.ROOT) match {
case "off" | "false" 0
case "on" | "true" Int.MaxValue
case _ config.getInt("akka.log-dead-letters")

View file

@ -16,6 +16,7 @@ import scala.concurrent.duration._
import scala.concurrent.Await
import scala.util.control.NoStackTrace
import scala.util.control.NonFatal
import java.util.Locale
/**
* This trait brings log level handling to the EventStream: it reads the log
@ -440,7 +441,7 @@ object Logging {
* valid inputs are upper or lowercase (not mixed) versions of:
* "error", "warning", "info" and "debug"
*/
def levelFor(s: String): Option[LogLevel] = s.toLowerCase match {
def levelFor(s: String): Option[LogLevel] = s.toLowerCase(Locale.ROOT) match {
case "off" Some(OffLevel)
case "error" Some(ErrorLevel)
case "warning" Some(WarningLevel)

View file

@ -10,10 +10,11 @@ import com.typesafe.config.Config
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.duration.Duration
import java.util.concurrent.TimeUnit
import java.util.Locale
object Helpers {
val isWindows: Boolean = System.getProperty("os.name", "").toLowerCase.indexOf("win") >= 0
val isWindows: Boolean = System.getProperty("os.name", "").toLowerCase(Locale.ROOT).indexOf("win") >= 0
def makePattern(s: String): Pattern = Pattern.compile("^\\Q" + s.replace("?", "\\E.\\Q").replace("*", "\\E.*\\Q") + "\\E$")

View file

@ -15,6 +15,7 @@ import akka.util.Helpers.Requiring
import akka.util.Helpers.ConfigOps
import scala.concurrent.duration.FiniteDuration
import akka.japi.Util.immutableSeq
import java.util.Locale
final class ClusterSettings(val config: Config, val systemName: String) {
@ -38,7 +39,7 @@ final class ClusterSettings(val config: Config, val systemName: String) {
val SeedNodeTimeout: FiniteDuration = cc.getMillisDuration("seed-node-timeout")
val RetryUnsuccessfulJoinAfter: Duration = {
val key = "retry-unsuccessful-join-after"
cc.getString(key).toLowerCase match {
cc.getString(key).toLowerCase(Locale.ROOT) match {
case "off" Duration.Undefined
case _ cc.getMillisDuration(key) requiring (_ > Duration.Zero, key + " > 0s, or off")
}
@ -52,7 +53,7 @@ final class ClusterSettings(val config: Config, val systemName: String) {
val UnreachableNodesReaperInterval: FiniteDuration = cc.getMillisDuration("unreachable-nodes-reaper-interval")
val PublishStatsInterval: Duration = {
val key = "publish-stats-interval"
cc.getString(key).toLowerCase match {
cc.getString(key).toLowerCase(Locale.ROOT) match {
case "off" Duration.Undefined
case _ cc.getMillisDuration(key) requiring (_ >= Duration.Zero, key + " >= 0s, or off")
}
@ -60,7 +61,7 @@ final class ClusterSettings(val config: Config, val systemName: String) {
val AutoDownUnreachableAfter: Duration = {
val key = "auto-down-unreachable-after"
cc.getString(key).toLowerCase match {
cc.getString(key).toLowerCase(Locale.ROOT) match {
case "off" Duration.Undefined
case _ cc.getMillisDuration(key) requiring (_ >= Duration.Zero, key + " >= 0s, or off")
}

View file

@ -15,6 +15,7 @@ import akka.actor.Props
import akka.event.Logging
import akka.event.Logging.LogLevel
import akka.ConfigurationException
import java.util.Locale
final class RemoteSettings(val config: Config) {
import config._
@ -29,7 +30,7 @@ final class RemoteSettings(val config: Config) {
val TrustedSelectionPaths: Set[String] =
immutableSeq(getStringList("akka.remote.trusted-selection-paths")).toSet
val RemoteLifecycleEventsLogLevel: LogLevel = getString("akka.remote.log-remote-lifecycle-events").toLowerCase() match {
val RemoteLifecycleEventsLogLevel: LogLevel = getString("akka.remote.log-remote-lifecycle-events").toLowerCase(Locale.ROOT) match {
case "on" Logging.DebugLevel
case other Logging.levelFor(other) match {
case Some(level) level