Update Scalafmt

This commit is contained in:
Eugene Yokota 2022-05-09 14:06:25 -04:00
parent f3d61a2106
commit 0a38e296ad
5 changed files with 29 additions and 24 deletions

View File

@ -1,4 +1,4 @@
version = 3.2.1
version = 3.5.2
runner.dialect = scala3
maxColumn = 100

View File

@ -547,13 +547,15 @@ object Terminal {
if (!closed.get)
readThread.synchronized {
readThread.set(Thread.currentThread)
try buffer.poll match {
case null =>
readQueue.put(())
result.put(buffer.take)
case b if b == -1 => throw new ClosedChannelException
case b => result.put(b)
} finally readThread.set(null)
try
buffer.poll match {
case null =>
readQueue.put(())
result.put(buffer.take)
case b if b == -1 => throw new ClosedChannelException
case b => result.put(b)
}
finally readThread.set(null)
}
override def read(): Int = {
val result = new LinkedBlockingQueue[Integer]

View File

@ -148,7 +148,7 @@ object InterfaceUtil {
override def equals(o: Any): Boolean = o match {
case o: ConcreteT2[A1, A2] =>
this.get1 == o.get1 &&
this.get2 == o.get2
this.get2 == o.get2
case _ => false
}
override def hashCode: Int = {

View File

@ -125,11 +125,12 @@ class Run(private[sbt] val newLoader: Seq[File] => ClassLoader, trapExit: Boolea
def run(mainClass: String, classpath: Seq[File], options: Seq[String], log: Logger): Try[Unit] = {
val loader = newLoader(classpath)
try runWithLoader(loader, classpath, mainClass, options, log)
finally loader match {
case ac: AutoCloseable => ac.close()
case c: ClasspathFilter => c.close()
case _ =>
}
finally
loader match {
case ac: AutoCloseable => ac.close()
case c: ClasspathFilter => c.close()
case _ =>
}
}
private def invokeMain(
loader: ClassLoader,

View File

@ -61,17 +61,19 @@ object CompletionService {
private[sbt] def submitFuture[A](work: () => A, completion: JCompletionService[A]): JFuture[A] = {
val future =
try completion.submit {
new Callable[A] {
def call =
try {
work()
} catch {
case _: InterruptedException =>
throw Incomplete(None, message = Some("cancelled"))
}
try
completion.submit {
new Callable[A] {
def call =
try {
work()
} catch {
case _: InterruptedException =>
throw Incomplete(None, message = Some("cancelled"))
}
}
}
} catch {
catch {
case _: RejectedExecutionException =>
throw Incomplete(None, message = Some("cancelled"))
}