mirror of https://github.com/sbt/sbt.git
Remove some warnings
This commit is contained in:
parent
844851d6d4
commit
299484cee6
|
|
@ -214,14 +214,14 @@ trait UnionImplicits {
|
|||
write0(i)
|
||||
}
|
||||
def equiv: Equiv[Internal] = new Equiv[Internal] {
|
||||
def equiv(a: Internal, b: Internal) =
|
||||
def equiv(a: Internal, b: Internal): Boolean =
|
||||
{
|
||||
if (a.clazz == b.clazz)
|
||||
force(a.cache.equiv, a.value, b.value)
|
||||
else
|
||||
false
|
||||
}
|
||||
def force[T <: UB, UB](e: Equiv[T], a: UB, b: UB) = e.equiv(a.asInstanceOf[T], b.asInstanceOf[T])
|
||||
def force[T <: UB, UB](e: Equiv[T], a: UB, b: UB): Boolean = e.equiv(a.asInstanceOf[T], b.asInstanceOf[T])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import scala.reflect.Manifest
|
|||
import sbt.io.Hash
|
||||
import sbt.serialization._
|
||||
|
||||
sealed trait FileInfo extends NotNull {
|
||||
sealed trait FileInfo {
|
||||
val file: File
|
||||
}
|
||||
@directSubclasses(Array(classOf[FileHash], classOf[HashModifiedFileInfo]))
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ object AttributeKey {
|
|||
def isLocal: Boolean = true
|
||||
def rank = Int.MaxValue
|
||||
}
|
||||
private[sbt] final val LocalLabel = "$local"
|
||||
private[sbt] final val LocalLabel = "$" + "local"
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ sealed trait KList[+M[_]] {
|
|||
def transform[N[_]](f: M ~> N): Transform[N]
|
||||
|
||||
/** Folds this list using a function that operates on the homogeneous type of the elements of this list. */
|
||||
def foldr[T](f: (M[_], T) => T, init: T): T = init // had trouble defining it in KNil
|
||||
def foldr[B](f: (M[_], B) => B, init: B): B = init // had trouble defining it in KNil
|
||||
|
||||
/** Applies `f` to the elements of this list in the applicative functor defined by `ap`. */
|
||||
def apply[N[x] >: M[x], Z](f: Transform[Id] => Z)(implicit ap: Applicative[N]): N[Z]
|
||||
|
|
@ -39,7 +39,7 @@ final case class KCons[H, +T <: KList[M], +M[_]](head: M[H], tail: T) extends KL
|
|||
np.apply(np.map(g, tt), f(head))
|
||||
}
|
||||
def :^:[A, N[x] >: M[x]](h: N[A]) = KCons(h, this)
|
||||
override def foldr[T](f: (M[_], T) => T, init: T): T = f(head, tail.foldr(f, init))
|
||||
override def foldr[B](f: (M[_], B) => B, init: B): B = f(head, tail.foldr(f, init))
|
||||
}
|
||||
sealed abstract class KNil extends KList[Nothing] {
|
||||
final type Transform[N[_]] = KNil
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ abstract class AbstractRMap[K[_], V[_]] extends RMap[K, V] {
|
|||
*/
|
||||
class DelegatingPMap[K[_], V[_]](backing: mutable.Map[K[_], V[_]]) extends AbstractRMap[K, V] with PMap[K, V] {
|
||||
def get[T](k: K[T]): Option[V[T]] = cast[T](backing.get(k))
|
||||
def update[T](k: K[T], v: V[T]) { backing(k) = v }
|
||||
def update[T](k: K[T], v: V[T]): Unit = { backing(k) = v }
|
||||
def remove[T](k: K[T]) = cast(backing.remove(k))
|
||||
def getOrUpdate[T](k: K[T], make: => V[T]) = cast[T](backing.getOrElseUpdate(k, make))
|
||||
def mapValue[T](k: K[T], init: V[T], f: V[T] => V[T]): V[T] =
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import Types._
|
|||
trait Param[A[_], B[_]] {
|
||||
type T
|
||||
def in: A[T]
|
||||
def ret(out: B[T])
|
||||
def ret(out: B[T]): Unit
|
||||
def ret: B[T]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -421,14 +421,10 @@ trait Init[Scope] {
|
|||
def dependencies: Seq[ScopedKey[_]]
|
||||
def apply[S](g: T => S): Initialize[S]
|
||||
|
||||
@deprecated("Will be made private.", "0.13.2")
|
||||
def mapReferenced(g: MapScoped): Initialize[T]
|
||||
@deprecated("Will be made private.", "0.13.2")
|
||||
def mapConstant(g: MapConstant): Initialize[T]
|
||||
|
||||
@deprecated("Will be made private.", "0.13.2")
|
||||
def validateReferenced(g: ValidateRef): ValidatedInit[T] =
|
||||
validateKeyReferenced(new ValidateKeyRef { def apply[T](key: ScopedKey[T], selfRefOk: Boolean) = g(key) })
|
||||
private[sbt] def mapReferenced(g: MapScoped): Initialize[T]
|
||||
private[sbt] def mapConstant(g: MapConstant): Initialize[T]
|
||||
private[sbt] def validateReferenced(g: ValidateRef): ValidatedInit[T] =
|
||||
validateKeyReferenced(new ValidateKeyRef { def apply[B](key: ScopedKey[B], selfRefOk: Boolean) = g(key) })
|
||||
|
||||
private[sbt] def validateKeyReferenced(g: ValidateKeyRef): ValidatedInit[T]
|
||||
|
||||
|
|
@ -482,14 +478,14 @@ trait Init[Scope] {
|
|||
private[sbt] def mapInitialize(f: Initialize[T] => Initialize[T]): Setting[T] = make(key, f(init), pos)
|
||||
override def toString = "setting(" + key + ") at " + pos
|
||||
|
||||
protected[this] def make[T](key: ScopedKey[T], init: Initialize[T], pos: SourcePosition): Setting[T] = new Setting[T](key, init, pos)
|
||||
protected[this] def make[B](key: ScopedKey[B], init: Initialize[B], pos: SourcePosition): Setting[B] = new Setting[B](key, init, pos)
|
||||
protected[sbt] def isDerived: Boolean = false
|
||||
private[sbt] def setScope(s: Scope): Setting[T] = make(key.copy(scope = s), init.mapReferenced(mapScope(const(s))), pos)
|
||||
/** Turn this setting into a `DefaultSetting` if it's not already, otherwise returns `this` */
|
||||
private[sbt] def default(id: => Long = nextDefaultID()): DefaultSetting[T] = DefaultSetting(key, init, pos, id)
|
||||
}
|
||||
private[Init] sealed class DerivedSetting[T](sk: ScopedKey[T], i: Initialize[T], p: SourcePosition, val filter: Scope => Boolean, val trigger: AttributeKey[_] => Boolean) extends Setting[T](sk, i, p) {
|
||||
override def make[T](key: ScopedKey[T], init: Initialize[T], pos: SourcePosition): Setting[T] = new DerivedSetting[T](key, init, pos, filter, trigger)
|
||||
override def make[B](key: ScopedKey[B], init: Initialize[B], pos: SourcePosition): Setting[B] = new DerivedSetting[B](key, init, pos, filter, trigger)
|
||||
protected[sbt] override def isDerived: Boolean = true
|
||||
override def default(_id: => Long): DefaultSetting[T] = new DerivedSetting[T](sk, i, p, filter, trigger) with DefaultSetting[T] { val id = _id }
|
||||
override def toString = "derived " + super.toString
|
||||
|
|
@ -498,7 +494,7 @@ trait Init[Scope] {
|
|||
// This is intended for internal sbt use only, where alternatives like Plugin.globalSettings are not available.
|
||||
private[Init] sealed trait DefaultSetting[T] extends Setting[T] {
|
||||
val id: Long
|
||||
override def make[T](key: ScopedKey[T], init: Initialize[T], pos: SourcePosition): Setting[T] = super.make(key, init, pos) default id
|
||||
override def make[B](key: ScopedKey[B], init: Initialize[B], pos: SourcePosition): Setting[B] = super.make(key, init, pos) default id
|
||||
override final def hashCode = id.hashCode
|
||||
override final def equals(o: Any): Boolean = o match { case d: DefaultSetting[_] => d.id == id; case _ => false }
|
||||
override def toString = s"default($id) " + super.toString
|
||||
|
|
@ -547,7 +543,7 @@ trait Init[Scope] {
|
|||
case None => this
|
||||
case Some(const) => new Value(() => transform(const))
|
||||
}
|
||||
private[sbt] def processAttributes[S](init: S)(f: (S, AttributeMap) => S): S = init
|
||||
private[sbt] def processAttributes[B](init: B)(f: (B, AttributeMap) => B): B = init
|
||||
}
|
||||
private[this] final class GetValue[S, T](val scopedKey: ScopedKey[S], val transform: S => T) extends Keyed[S, T]
|
||||
trait KeyedInitialize[T] extends Keyed[T, T] {
|
||||
|
|
@ -585,7 +581,7 @@ trait Init[Scope] {
|
|||
new Bind[S, T](s => handleUndefined(f(s) validateKeyReferenced g), validIn)
|
||||
}
|
||||
def mapConstant(g: MapConstant) = new Bind[S, T](s => f(s) mapConstant g, in mapConstant g)
|
||||
private[sbt] def processAttributes[S](init: S)(f: (S, AttributeMap) => S): S = in.processAttributes(init)(f)
|
||||
private[sbt] def processAttributes[B](init: B)(f: (B, AttributeMap) => B): B = in.processAttributes(init)(f)
|
||||
}
|
||||
private[sbt] final class Optional[S, T](val a: Option[Initialize[S]], val f: Option[S] => T) extends Initialize[T] {
|
||||
def dependencies = deps(a.toList)
|
||||
|
|
@ -599,7 +595,7 @@ trait Init[Scope] {
|
|||
def evaluate(ss: Settings[Scope]): T = f(a.flatMap(i => trapBadRef(evaluateT(ss)(i))))
|
||||
// proper solution is for evaluate to be deprecated or for external use only and a new internal method returning Either be used
|
||||
private[this] def trapBadRef[A](run: => A): Option[A] = try Some(run) catch { case e: InvalidReference => None }
|
||||
private[sbt] def processAttributes[S](init: S)(f: (S, AttributeMap) => S): S = a match {
|
||||
private[sbt] def processAttributes[B](init: B)(f: (B, AttributeMap) => B): B = a match {
|
||||
case None => init
|
||||
case Some(i) => i.processAttributes(init)(f)
|
||||
}
|
||||
|
|
@ -633,7 +629,7 @@ trait Init[Scope] {
|
|||
{
|
||||
val tx = alist.transform(inputs, validateKeyReferencedT(g))
|
||||
val undefs = alist.toList(tx).flatMap(_.left.toSeq.flatten)
|
||||
val get = new (ValidatedInit ~> Initialize) { def apply[T](vr: ValidatedInit[T]) = vr.right.get }
|
||||
val get = new (ValidatedInit ~> Initialize) { def apply[B](vr: ValidatedInit[B]) = vr.right.get }
|
||||
if (undefs.isEmpty) Right(new Apply(f, alist.transform(tx, get), alist)) else Left(undefs)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ object Signals {
|
|||
import sun.misc.{ Signal, SignalHandler }
|
||||
val intSignal = new Signal(signal)
|
||||
val newHandler = new SignalHandler {
|
||||
def handle(sig: Signal) { handler() }
|
||||
def handle(sig: Signal): Unit = { handler() }
|
||||
}
|
||||
val oldHandler = Signal.handle(intSignal, newHandler)
|
||||
object unregisterNewHandler extends Registration {
|
||||
|
|
@ -74,7 +74,7 @@ private final class Signals0 {
|
|||
import sun.misc.{ Signal, SignalHandler }
|
||||
val intSignal = new Signal(signal)
|
||||
val newHandler = new SignalHandler {
|
||||
def handle(sig: Signal) { handler() }
|
||||
def handle(sig: Signal): Unit = { handler() }
|
||||
}
|
||||
|
||||
val oldHandler = Signal.handle(intSignal, newHandler)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ abstract class JLine extends LineReader {
|
|||
}
|
||||
}
|
||||
|
||||
private[this] def resume() {
|
||||
private[this] def resume(): Unit = {
|
||||
jline.TerminalFactory.reset
|
||||
JLine.terminal.init
|
||||
reader.drawLine()
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ package complete
|
|||
import History.number
|
||||
import java.io.File
|
||||
|
||||
final class History private (val lines: IndexedSeq[String], val path: Option[File], error: String => Unit) extends NotNull {
|
||||
final class History private (val lines: IndexedSeq[String], val path: Option[File], error: String => Unit) {
|
||||
private def reversed = lines.reverse
|
||||
|
||||
def all: Seq[String] = lines
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ object StackTrace {
|
|||
require(d >= 0)
|
||||
val b = new StringBuilder()
|
||||
|
||||
def appendStackTrace(t: Throwable, first: Boolean) {
|
||||
def appendStackTrace(t: Throwable, first: Boolean): Unit = {
|
||||
|
||||
val include: StackTraceElement => Boolean =
|
||||
if (d == 0)
|
||||
|
|
@ -30,7 +30,7 @@ object StackTrace {
|
|||
(_ => { count -= 1; count >= 0 })
|
||||
}
|
||||
|
||||
def appendElement(e: StackTraceElement) {
|
||||
def appendElement(e: StackTraceElement): Unit = {
|
||||
b.append("\tat ")
|
||||
b.append(e)
|
||||
b.append('\n')
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
package sbt.util
|
||||
|
||||
sealed trait LogEvent extends NotNull
|
||||
sealed trait LogEvent
|
||||
final class Success(val msg: String) extends LogEvent
|
||||
final class Log(val level: Level.Value, val msg: String) extends LogEvent
|
||||
final class Trace(val exception: Throwable) extends LogEvent
|
||||
|
|
|
|||
|
|
@ -103,14 +103,14 @@ object LogWriterTest extends Properties("Log Writer") {
|
|||
|
||||
/* Helper classes*/
|
||||
|
||||
final class Output(val lines: List[List[ToLog]], val level: Level.Value) extends NotNull {
|
||||
final class Output(val lines: List[List[ToLog]], val level: Level.Value) {
|
||||
override def toString =
|
||||
"Level: " + level + "\n" + lines.map(_.mkString).mkString("\n")
|
||||
}
|
||||
final class NewLine(val str: String) extends NotNull {
|
||||
final class NewLine(val str: String) {
|
||||
override def toString = Escape(str)
|
||||
}
|
||||
final class ToLog(val content: String, val byCharacter: Boolean) extends NotNull {
|
||||
final class ToLog(val content: String, val byCharacter: Boolean) {
|
||||
def contentOnly = Escape.newline(content, "")
|
||||
override def toString = if (content.isEmpty) "" else "ToLog('" + Escape(contentOnly) + "', " + byCharacter + ")"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ object ChangeReport {
|
|||
}
|
||||
}
|
||||
/** The result of comparing some current set of objects against a previous set of objects.*/
|
||||
trait ChangeReport[T] extends NotNull {
|
||||
trait ChangeReport[T] {
|
||||
/** The set of all of the objects in the current set.*/
|
||||
def checked: Set[T]
|
||||
/** All of the objects that are in the same state in the current and reference sets.*/
|
||||
|
|
|
|||
|
|
@ -234,23 +234,23 @@ object FileFunction {
|
|||
type UpdateFunction = (ChangeReport[File], ChangeReport[File]) => Set[File]
|
||||
|
||||
/**
|
||||
Generic change-detection helper used to help build / artifact generation /
|
||||
etc. steps detect whether or not they need to run. Returns a function whose
|
||||
input is a Set of input files, and subsequently executes the action function
|
||||
(which does the actual work: compiles, generates resources, etc.), returning
|
||||
a Set of output files that it generated.
|
||||
|
||||
The input file and resulting output file state is cached in
|
||||
cacheBaseDirectory. On each invocation, the state of the input and output
|
||||
files from the previous run is compared against the cache, as is the set of
|
||||
input files. If a change in file state / input files set is detected, the
|
||||
action function is re-executed.
|
||||
|
||||
@param cacheBaseDirectory The folder in which to store
|
||||
@param inStyle The strategy by which to detect state change in the input files from the previous run
|
||||
@param outStyle The strategy by which to detect state change in the output files from the previous run
|
||||
@param action The work function, which receives a list of input files and returns a list of output files
|
||||
*/
|
||||
* Generic change-detection helper used to help build / artifact generation /
|
||||
* etc. steps detect whether or not they need to run. Returns a function whose
|
||||
* input is a Set of input files, and subsequently executes the action function
|
||||
* (which does the actual work: compiles, generates resources, etc.), returning
|
||||
* a Set of output files that it generated.
|
||||
*
|
||||
* The input file and resulting output file state is cached in
|
||||
* cacheBaseDirectory. On each invocation, the state of the input and output
|
||||
* files from the previous run is compared against the cache, as is the set of
|
||||
* input files. If a change in file state / input files set is detected, the
|
||||
* action function is re-executed.
|
||||
*
|
||||
* @param cacheBaseDirectory The folder in which to store
|
||||
* @param inStyle The strategy by which to detect state change in the input files from the previous run
|
||||
* @param outStyle The strategy by which to detect state change in the output files from the previous run
|
||||
* @param action The work function, which receives a list of input files and returns a list of output files
|
||||
*/
|
||||
def cached(cacheBaseDirectory: File, inStyle: FilesInfo.Style = FilesInfo.lastModified, outStyle: FilesInfo.Style = FilesInfo.exists)(action: Set[File] => Set[File]): Set[File] => Set[File] =
|
||||
cached(cacheBaseDirectory)(inStyle, outStyle)((in, out) => action(in.checked))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue