Skip to content

Commit

Permalink
refactor: remove deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
etorreborre committed Aug 5, 2023
1 parent a6110d6 commit a73451e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ lazy val compilationOptions = Seq(
"-language:implicitConversions,postfixOps",
"-Ykind-projector",
"-Xcheck-macros",
"-deprecation:false",
"-deprecation:true",
"-unchecked",
"-feature"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package org.specs2
package data

import scala.collection.mutable
import scala.util.control.NonLocalReturns.*
import scala.util.boundary
import scala.util.boundary.*

/** Hopcroft-Karp (https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm) algorithm for finding the maximum
* matching in a bipartite graph
Expand Down Expand Up @@ -38,13 +39,13 @@ object HopcroftKarp:
}
dist(nil) != Int.MaxValue

def dfs(v: Int): Boolean = returning {
def dfs(v: Int): Boolean = boundary {
if v != -1 then
edges.get(v).toSeq.flatten.foreach { u =>
if dist(pair2(u)) == dist(v) + 1 && dfs(pair2(u)) then
pair2.put(u, v)
pair1.put(v, u)
throwReturn(true)
break(true)
}
dist.put(v, Int.MaxValue)
false
Expand Down
4 changes: 2 additions & 2 deletions junit/src/main/scala/org/specs2/runner/Specs2TestEngine.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.specs2.runner

import collection.convert.ImplicitConversions.*
import scala.jdk.CollectionConverters.*

import org.junit.platform.engine.*
import org.junit.platform.engine.discovery.*
Expand Down Expand Up @@ -65,7 +65,7 @@ class Specs2TestEngine extends TestEngine:
listener.executionStarted(descriptor)
descriptor match
case Specs2EngineContainerDescriptor(_, _) =>
descriptor.getChildren.foreach(d => executeTest(d, listener))
descriptor.getChildren.asScala.foreach(d => executeTest(d, listener))
listener.executionFinished(descriptor, TestExecutionResult.successful)
case Specs2EngineTestDescriptor(_, _, execution) =>
execution.startExecution(env).executionResult.runAction(env.executionEnv) match
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ trait JsonSelectors:

def select(value: Any): Option[Any] =
value.asInstanceOf[Matchable] match
case l: List[_] => this.select(l)
case m: Map[_, _] => this.select(m)
case l: List[?] => this.select(l)
case m: Map[?, ?] => this.select(m)
case _ => None

def name: String =
Expand Down Expand Up @@ -431,8 +431,8 @@ trait JsonSelectors:

def select(value: Any): Option[Any] =
value.asInstanceOf[Matchable] match
case m: Map[_, _] => this.select(m)
case kv: (_, _) => this.select(kv)
case m: Map[?, ?] => this.select(m)
case kv: (?, ?) => this.select(kv)
case _ => None

def name: String =
Expand All @@ -453,9 +453,9 @@ trait JsonSelectors:

def select(value: Any): Option[Any] =
value.asInstanceOf[Matchable] match
case l: List[_] => this.select(l)
case m: Map[_, _] => this.select(m)
case kv: (_, _) => this.select(kv.asInstanceOf[(String, Any)])
case l: List[?] => this.select(l)
case m: Map[?, ?] => this.select(m)
case kv: (?, ?) => this.select(kv.asInstanceOf[(String, Any)])
case _ => None

def name: String =
Expand Down

0 comments on commit a73451e

Please sign in to comment.