mirror of https://github.com/sbt/sbt.git
Merge pull request #1663 from sbt/wip/avoid-deprecated
enable -deprecation for Scala 2.10
This commit is contained in:
commit
ba04f7761d
|
|
@ -92,7 +92,7 @@ trait Init[Scope] {
|
|||
* Only the static dependencies are tracked, however. Dependencies on previous values do not introduce a derived setting either.
|
||||
*/
|
||||
final def derive[T](s: Setting[T], allowDynamic: Boolean = false, filter: Scope => Boolean = const(true), trigger: AttributeKey[_] => Boolean = const(true), default: Boolean = false): Setting[T] = {
|
||||
deriveAllowed(s, allowDynamic) foreach error
|
||||
deriveAllowed(s, allowDynamic) foreach sys.error
|
||||
val d = new DerivedSetting[T](s.key, s.init, s.pos, filter, trigger)
|
||||
if (default) d.default() else d
|
||||
}
|
||||
|
|
@ -248,7 +248,7 @@ trait Init[Scope] {
|
|||
new Undefined(fakeUndefinedSetting(definingKey, derived), referencedKey)
|
||||
private[this] def fakeUndefinedSetting[T](definingKey: ScopedKey[T], d: Boolean): Setting[T] =
|
||||
{
|
||||
val init: Initialize[T] = pure(() => error("Dummy setting for compatibility only."))
|
||||
val init: Initialize[T] = pure(() => sys.error("Dummy setting for compatibility only."))
|
||||
new Setting(definingKey, init, NoPosition) { override def isDerived = d }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ final class History private (val lines: IndexedSeq[String], val path: Option[Fil
|
|||
def all: Seq[String] = lines
|
||||
def size = lines.length
|
||||
def !! : Option[String] = !-(1)
|
||||
def apply(i: Int): Option[String] = if (0 <= i && i < size) Some(lines(i)) else { error("Invalid history index: " + i); None }
|
||||
def apply(i: Int): Option[String] = if (0 <= i && i < size) Some(lines(i)) else { sys.error("Invalid history index: " + i); None }
|
||||
def !(i: Int): Option[String] = apply(i)
|
||||
|
||||
def !(s: String): Option[String] =
|
||||
|
|
@ -27,7 +27,7 @@ final class History private (val lines: IndexedSeq[String], val path: Option[Fil
|
|||
|
||||
private def nonEmpty[T](s: String)(act: => Option[T]): Option[T] =
|
||||
if (s.isEmpty) {
|
||||
error("No action specified to history command")
|
||||
sys.error("No action specified to history command")
|
||||
None
|
||||
} else
|
||||
act
|
||||
|
|
@ -37,7 +37,7 @@ final class History private (val lines: IndexedSeq[String], val path: Option[Fil
|
|||
}
|
||||
|
||||
object History {
|
||||
def apply(lines: Seq[String], path: Option[File], error: String => Unit): History = new History(lines.toIndexedSeq, path, error)
|
||||
def apply(lines: Seq[String], path: Option[File], error: String => Unit): History = new History(lines.toIndexedSeq, path, sys.error)
|
||||
|
||||
def number(s: String): Option[Int] =
|
||||
try { Some(s.toInt) }
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ object Logic {
|
|||
if (newlyFalse.nonEmpty)
|
||||
newlyFalse
|
||||
else // should never happen due to the acyclic negation rule
|
||||
error(s"No progress:\n\tclauses: $clauses\n\tpossibly true: $possiblyTrue")
|
||||
sys.error(s"No progress:\n\tclauses: $clauses\n\tpossibly true: $possiblyTrue")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ object LogicTest extends Properties("Logic") {
|
|||
Logic.reduceAll(badClauses, Set()) match {
|
||||
case Right(res) => false
|
||||
case Left(err: Logic.CyclicNegation) => true
|
||||
case Left(err) => error(s"Expected cyclic error, got: $err")
|
||||
case Left(err) => sys.error(s"Expected cyclic error, got: $err")
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ object LogicTest extends Properties("Logic") {
|
|||
case Left(err) => false
|
||||
case Right(res) =>
|
||||
val actual = res.provenSet
|
||||
(actual == expected) || error(s"Expected to prove $expected, but actually proved $actual")
|
||||
(actual == expected) || sys.error(s"Expected to prove $expected, but actually proved $actual")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ private abstract class AbstractProcessBuilder extends ProcessBuilder with SinkPa
|
|||
{
|
||||
val buffer = new StringBuffer
|
||||
val code = this ! BasicIO(buffer, log, withIn)
|
||||
if (code == 0) buffer.toString else error("Nonzero exit value: " + code)
|
||||
if (code == 0) buffer.toString else sys.error("Nonzero exit value: " + code)
|
||||
}
|
||||
def !! = getString(None, false)
|
||||
def !!(log: ProcessLogger) = getString(Some(log), false)
|
||||
|
|
@ -190,7 +190,7 @@ private abstract class BasicProcess extends Process {
|
|||
|
||||
private abstract class CompoundProcess extends BasicProcess {
|
||||
def destroy() { destroyer() }
|
||||
def exitValue() = getExitValue().getOrElse(error("No exit code: process destroyed."))
|
||||
def exitValue() = getExitValue().getOrElse(sys.error("No exit code: process destroyed."))
|
||||
|
||||
def start() = getExitValue
|
||||
|
||||
|
|
@ -426,7 +426,7 @@ private object Streamed {
|
|||
def next(): Stream[T] =
|
||||
q.take match {
|
||||
case Left(0) => Stream.empty
|
||||
case Left(code) => if (nonzeroException) error("Nonzero exit code: " + code) else Stream.empty
|
||||
case Left(code) => if (nonzeroException) sys.error("Nonzero exit code: " + code) else Stream.empty
|
||||
case Right(s) => Stream.cons(s, next)
|
||||
}
|
||||
new Streamed((s: T) => q.put(Right(s)), code => q.put(Left(code)), () => next())
|
||||
|
|
|
|||
Loading…
Reference in New Issue