diff options
author | Rocky Madden <git@rockymadden.com> | 2013-01-08 22:02:46 -0700 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2013-01-08 22:02:46 -0700 |
commit | 7a56275bce5d3486fdac9c178eb04e3f9c4f2267 (patch) | |
tree | 8d9342a5eb9f9d7d8e125cd96f0c0935c01b43a9 /cli/source | |
parent | 27e1aa466d8f01af3409ff167b39ac355b93ab3b (diff) | |
download | stringmetric-7a56275bce5d3486fdac9c178eb04e3f9c4f2267.tar.gz stringmetric-7a56275bce5d3486fdac9c178eb04e3f9c4f2267.tar.bz2 stringmetric-7a56275bce5d3486fdac9c178eb04e3f9c4f2267.zip |
Added explicit catch type to prevent warnings.
Diffstat (limited to 'cli/source')
19 files changed, 46 insertions, 46 deletions
diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/OptionMapType.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/OptionMapType.scala index 6dfc869..80cfc72 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/OptionMapType.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/OptionMapType.scala @@ -8,37 +8,37 @@ final case class OptionMapArray(arrayString: String) extends OptionMapType[Array private[this] lazy val self = try { if (stringSelf.length == 0) None else Some(stringSelf.split(" ")) - } catch { case _ => None } + } catch { case _: Throwable => None } override def get() = self } final case class OptionMapBigDecimal(bigDecimalString: String) extends OptionMapType[BigDecimal](bigDecimalString) { - private[this] lazy val self = try { Some(BigDecimal(stringSelf)) } catch { case _ => None } + private[this] lazy val self = try { Some(BigDecimal(stringSelf)) } catch { case _: Throwable => None } override def get() = self } final case class OptionMapBigInt(bigIntString: String) extends OptionMapType[BigInt](bigIntString) { - private[this] lazy val self = try { Some(BigInt(stringSelf)) } catch { case _ => None } + private[this] lazy val self = try { Some(BigInt(stringSelf)) } catch { case _: Throwable => None } override def get() = self } final case class OptionMapDouble(doubleString: String) extends OptionMapType[Double](doubleString) { - private[this] lazy val self = try { Some(stringSelf.toDouble) } catch { case _ => None } + private[this] lazy val self = try { Some(stringSelf.toDouble) } catch { case _: Throwable => None } override def get() = self } final case class OptionMapFloat(floatString: String) extends OptionMapType[Float](floatString) { - private[this] lazy val self = try { Some(stringSelf.toFloat) } catch { case _ => None } + private[this] lazy val self = try { Some(stringSelf.toFloat) } catch { case _: Throwable => None } override def get() = self } final case class OptionMapInt(intString: String) extends OptionMapType[Int](intString) { - private[this] lazy val self = try { Some(stringSelf.toInt) } catch { case _ => None } + private[this] lazy val self = try { Some(stringSelf.toInt) } catch { case _: Throwable => None } override def get() = self } @@ -47,19 +47,19 @@ final case class OptionMapList(listString: String) extends OptionMapType[List[St private[this] lazy val self = try { if (stringSelf.length == 0) None else Some(stringSelf.split(" ").toList) - } catch { case _ => None } + } catch { case _: Throwable => None } override def get() = self } final case class OptionMapLong(longString: String) extends OptionMapType[Long](longString) { - private[this] lazy val self = try { Some(stringSelf.toLong) } catch { case _ => None } + private[this] lazy val self = try { Some(stringSelf.toLong) } catch { case _: Throwable => None } override def get() = self } final case class OptionMapShort(shortString: String) extends OptionMapType[Short](shortString) { - private[this] lazy val self = try { Some(stringSelf.toShort) } catch { case _ => None } + private[this] lazy val self = try { Some(stringSelf.toShort) } catch { case _: Throwable => None } override def get() = self } @@ -88,4 +88,4 @@ object OptionMapType { implicit def StringToOptionMapLong(string: String): OptionMapLong = new OptionMapLong(string) implicit def StringToOptionMapShort(string: String): OptionMapShort = new OptionMapShort(string) -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/metaphoneAlgorithm.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/metaphoneAlgorithm.scala index e12e020..c66c9db 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/metaphoneAlgorithm.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/metaphoneAlgorithm.scala @@ -23,7 +23,7 @@ object metaphoneAlgorithm extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -47,4 +47,4 @@ object metaphoneAlgorithm extends Command { options('dashless) ).getOrElse("not computable") ) -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/metaphoneMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/metaphoneMetric.scala index 01bb4f2..c89c55e 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/metaphoneMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/metaphoneMetric.scala @@ -23,7 +23,7 @@ object metaphoneMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -51,4 +51,4 @@ object metaphoneMetric extends Command { ).getOrElse("not comparable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisAlgorithm.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisAlgorithm.scala index a318934..df50986 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisAlgorithm.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisAlgorithm.scala @@ -23,7 +23,7 @@ object nysiisAlgorithm extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -47,4 +47,4 @@ object nysiisAlgorithm extends Command { options('dashless) ).getOrElse("not computable") ) -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisMetric.scala index 09d172c..58157ca 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/nysiisMetric.scala @@ -23,7 +23,7 @@ object nysiisMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -51,4 +51,4 @@ object nysiisMetric extends Command { ).getOrElse("not comparable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisAlgorithm.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisAlgorithm.scala index 6c9d471..b11e369 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisAlgorithm.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisAlgorithm.scala @@ -23,7 +23,7 @@ object refinedNysiisAlgorithm extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -47,4 +47,4 @@ object refinedNysiisAlgorithm extends Command { options('dashless) ).getOrElse("not computable") ) -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisMetric.scala index c096af1..3b78565 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedNysiisMetric.scala @@ -23,7 +23,7 @@ object refinedNysiisMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -51,4 +51,4 @@ object refinedNysiisMetric extends Command { ).getOrElse("not comparable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedSoundexAlgorithm.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedSoundexAlgorithm.scala index 6ae8d54..2d9a8ad 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedSoundexAlgorithm.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedSoundexAlgorithm.scala @@ -23,7 +23,7 @@ object refinedSoundexAlgorithm extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -47,4 +47,4 @@ object refinedSoundexAlgorithm extends Command { options('dashless) ).getOrElse("not computable") ) -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedSoundexMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedSoundexMetric.scala index b426fe4..a0101e8 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedSoundexMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/refinedSoundexMetric.scala @@ -23,7 +23,7 @@ object refinedSoundexMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -51,4 +51,4 @@ object refinedSoundexMetric extends Command { ).getOrElse("not comparable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/soundexAlgorithm.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/soundexAlgorithm.scala index 4a4600a..ecbea71 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/soundexAlgorithm.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/soundexAlgorithm.scala @@ -23,7 +23,7 @@ object soundexAlgorithm extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -47,4 +47,4 @@ object soundexAlgorithm extends Command { options('dashless) ).getOrElse("not computable") ) -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/soundexMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/soundexMetric.scala index c6e2d39..77f49fd 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/soundexMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/phonetic/soundexMetric.scala @@ -23,7 +23,7 @@ object soundexMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -51,4 +51,4 @@ object soundexMetric extends Command { ).getOrElse("not comparable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/diceSorensenMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/diceSorensenMetric.scala index 0346038..c2a21b5 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/diceSorensenMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/diceSorensenMetric.scala @@ -25,7 +25,7 @@ object diceSorensenMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -56,4 +56,4 @@ object diceSorensenMetric extends Command { )(n).getOrElse("not comparable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/hammingMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/hammingMetric.scala index 9293745..d88f2c9 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/hammingMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/hammingMetric.scala @@ -23,7 +23,7 @@ object hammingMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -51,4 +51,4 @@ object hammingMetric extends Command { ).getOrElse("not comparable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/jaroMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/jaroMetric.scala index 27f1e8c..2f43bf9 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/jaroMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/jaroMetric.scala @@ -20,7 +20,7 @@ object jaroMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -48,4 +48,4 @@ object jaroMetric extends Command { ).getOrElse("not comparable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/jaroWinklerMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/jaroWinklerMetric.scala index b2a65d4..7d9f032 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/jaroWinklerMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/jaroWinklerMetric.scala @@ -23,7 +23,7 @@ object jaroWinklerMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -51,4 +51,4 @@ object jaroWinklerMetric extends Command { ).getOrElse("not comparable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/levenshteinMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/levenshteinMetric.scala index 273a369..2abe7f0 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/levenshteinMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/levenshteinMetric.scala @@ -23,7 +23,7 @@ object levenshteinMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -52,4 +52,4 @@ object levenshteinMetric extends Command { ).getOrElse("not comparable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/nGramAlgorithm.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/nGramAlgorithm.scala index 58ea028..195726f 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/nGramAlgorithm.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/nGramAlgorithm.scala @@ -24,7 +24,7 @@ object nGramAlgorithm extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -51,4 +51,4 @@ object nGramAlgorithm extends Command { NGramAlgorithm.compute(options('dashless))(n).map(_.mkString("|")).getOrElse("not computable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/nGramMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/nGramMetric.scala index 435a90a..23428be 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/nGramMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/nGramMetric.scala @@ -25,7 +25,7 @@ object nGramMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -56,4 +56,4 @@ object nGramMetric extends Command { )(n).getOrElse("not comparable") ) } -}
\ No newline at end of file +} diff --git a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/weightedLevenshteinMetric.scala b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/weightedLevenshteinMetric.scala index 18389a4..c732372 100755 --- a/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/weightedLevenshteinMetric.scala +++ b/cli/source/core/scala/com/rockymadden/stringmetric/cli/similarity/weightedLevenshteinMetric.scala @@ -29,7 +29,7 @@ object weightedLevenshteinMetric extends Command { // Invalid syntax. } else throw new IllegalArgumentException("Expected valid syntax. See --help.") } catch { - case e => error(e, options) + case e: Throwable => error(e, options) } } @@ -69,4 +69,4 @@ object weightedLevenshteinMetric extends Command { )(weights).getOrElse("not comparable") ) } -}
\ No newline at end of file +} |