Skip to content

Commit

Permalink
Merge pull request #148 from xuwei-k/Scala-2.13.0-M4
Browse files Browse the repository at this point in the history
fix compile error in Scala 2.13.0-M4
  • Loading branch information
eed3si9n authored May 8, 2018
2 parents d8a23ca + 6c4364e commit 8c4fddc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion io/src/main/scala/sbt/internal/io/EventMonitor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private[sbt] object EventMonitor {
recentEvents = recentEvents.filterNot(_._2.isOverdue)
getFilesForKey(s.service.poll(delay)).foreach(maybeTrigger)
}
def getFilesForKey(key: WatchKey): Seq[Path] = key match {
def getFilesForKey(key: WatchKey): collection.Seq[Path] = key match {
case null => Nil
case k =>
val allEvents = k.pollEvents.asScala
Expand Down
8 changes: 4 additions & 4 deletions io/src/main/scala/sbt/io/MacOSXWatchService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ class MacOSXWatchService extends WatchService with Unregisterable {
readyKeys.poll(timeout.toNanos, TimeUnit.NANOSECONDS)
} else throw new ClosedWatchServiceException

override def pollEvents(): Map[WatchKey, Seq[WatchEvent[JPath]]] =
override def pollEvents(): Map[WatchKey, collection.Seq[WatchEvent[JPath]]] =
registered
.synchronized(registered.flatMap {
case (_, (k, _)) =>
val events = k.pollEvents()
if (events.isEmpty) None
else Some(k -> events.asScala.map(_.asInstanceOf[WatchEvent[JPath]]))
if (events.isEmpty) Nil
else Seq(k -> events.asScala.map(_.asInstanceOf[WatchEvent[JPath]]))
})
.toMap[WatchKey, Seq[WatchEvent[JPath]]]
.toMap[WatchKey, collection.Seq[WatchEvent[JPath]]]

override def register(path: JPath, events: WatchEvent.Kind[JPath]*): WatchKey = {
if (isOpen) {
Expand Down
2 changes: 1 addition & 1 deletion io/src/main/scala/sbt/io/WatchService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ trait WatchService {
* Does not wait if no event is available.
* @return The pending events.
*/
def pollEvents(): Map[WatchKey, Seq[WatchEvent[JPath]]]
def pollEvents(): Map[WatchKey, collection.Seq[WatchEvent[JPath]]]

/**
* Retrieves the next `WatchKey` that has a `WatchEvent` waiting. Waits
Expand Down

0 comments on commit 8c4fddc

Please sign in to comment.