diff --git a/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpBrowserGraphStage.scala b/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpBrowserGraphStage.scala index 72002a5567..39e09d669d 100644 --- a/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpBrowserGraphStage.scala +++ b/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpBrowserGraphStage.scala @@ -21,7 +21,7 @@ private[ftp] trait FtpBrowserGraphStage[FtpClient, S <: RemoteFileSettings] def emitTraversedDirectories: Boolean = false - def createLogic(inheritedAttributes: Attributes) = { + def createLogic(inheritedAttributes: Attributes): FtpGraphStageLogic[FtpFile, FtpClient, S] = { val logic = new FtpGraphStageLogic[FtpFile, FtpClient, S](shape, ftpLike, connectionSettings, ftpClient) { private[this] var buffer: Seq[FtpFile] = Seq.empty[FtpFile] @@ -75,9 +75,9 @@ private[ftp] trait FtpBrowserGraphStage[FtpClient, S <: RemoteFileSettings] private[this] def getFilesFromPath(basePath: String) = if (basePath.isEmpty) - ftpLike.listFiles(handler.get) + logicFtpLike.listFiles(handler.get) else - ftpLike.listFiles(basePath, handler.get) + logicFtpLike.listFiles(basePath, handler.get) } // end of stage logic diff --git a/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpDirectoryOperationsGraphStage.scala b/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpDirectoryOperationsGraphStage.scala index 674bfa29ae..dbe9a62d04 100644 --- a/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpDirectoryOperationsGraphStage.scala +++ b/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpDirectoryOperationsGraphStage.scala @@ -21,7 +21,7 @@ private[ftp] trait FtpDirectoryOperationsGraphStage[FtpClient, S <: RemoteFileSe out, new OutHandler { override def onPull(): Unit = { - push(out, ftpLike.mkdir(basePath, directoryName, handler.get)) + push(out, logicFtpLike.mkdir(basePath, directoryName, handler.get)) complete(out) } } diff --git a/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpGraphStageLogic.scala b/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpGraphStageLogic.scala index 1c4f438a04..9c62b1b37a 100644 --- a/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpGraphStageLogic.scala +++ b/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpGraphStageLogic.scala @@ -19,19 +19,19 @@ import scala.util.control.NonFatal @InternalApi private[ftp] abstract class FtpGraphStageLogic[T, FtpClient, S <: RemoteFileSettings]( val shape: Shape, - val ftpLike: FtpLike[FtpClient, S], + val logicFtpLike: FtpLike[FtpClient, S], val connectionSettings: S, val ftpClient: () => FtpClient ) extends GraphStageLogic(shape) { protected[this] implicit val client: FtpClient = ftpClient() - protected[this] var handler: Option[ftpLike.Handler] = Option.empty[ftpLike.Handler] + protected[this] var handler: Option[logicFtpLike.Handler] = Option.empty[logicFtpLike.Handler] protected[this] var failed = false override def preStart(): Unit = { super.preStart() try { - val tryConnect = ftpLike.connect(connectionSettings) + val tryConnect = logicFtpLike.connect(connectionSettings) if (tryConnect.isSuccess) { handler = tryConnect.toOption } else @@ -67,7 +67,7 @@ private[ftp] abstract class FtpGraphStageLogic[T, FtpClient, S <: RemoteFileSett protected[this] def doPreStart(): Unit protected[this] def disconnect(): Unit = - handler.foreach(ftpLike.disconnect) + handler.foreach(logicFtpLike.disconnect) protected[this] def matSuccess(): Boolean diff --git a/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpIOGraphStage.scala b/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpIOGraphStage.scala index 0c927eabc5..74115f0cc8 100644 --- a/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpIOGraphStage.scala +++ b/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpIOGraphStage.scala @@ -110,13 +110,13 @@ private[ftp] trait FtpIOSourceStage[FtpClient, S <: RemoteFileSettings] } protected[this] def doPreStart(): Unit = - isOpt = ftpLike match { + isOpt = logicFtpLike match { case ur: UnconfirmedReads => withUnconfirmedReads(ur) case ro: RetrieveOffset => Some(ro.retrieveFileInputStream(path, handler.get.asInstanceOf[ro.Handler], offset).get) case _ => - Some(ftpLike.retrieveFileInputStream(path, handler.get).get) + Some(logicFtpLike.retrieveFileInputStream(path, handler.get).get) } private def withUnconfirmedReads( @@ -236,7 +236,7 @@ private[ftp] trait FtpIOSinkStage[FtpClient, S <: RemoteFileSettings] } protected[this] def doPreStart(): Unit = { - osOpt = Some(ftpLike.storeFileOutputStream(path, handler.get, append).get) + osOpt = Some(logicFtpLike.storeFileOutputStream(path, handler.get, append).get) pull(in) } @@ -286,7 +286,7 @@ private[ftp] trait FtpMoveSink[FtpClient, S <: RemoteFileSettings] override def onPush(): Unit = { try { val sourcePath = grab(in) - ftpLike.move(sourcePath.path, destinationPath(sourcePath), handler.get) + logicFtpLike.move(sourcePath.path, destinationPath(sourcePath), handler.get) numberOfMovedFiles = numberOfMovedFiles + 1 pull(in) } catch { @@ -342,7 +342,7 @@ private[ftp] trait FtpRemoveSink[FtpClient, S <: RemoteFileSettings] new InHandler { override def onPush(): Unit = { try { - ftpLike.remove(grab(in).path, handler.get) + logicFtpLike.remove(grab(in).path, handler.get) numberOfRemovedFiles = numberOfRemovedFiles + 1 pull(in) } catch { diff --git a/google-cloud-storage/src/test/scala/akka/stream/alpakka/googlecloud/storage/scaladsl/GCStorageWiremockBase.scala b/google-cloud-storage/src/test/scala/akka/stream/alpakka/googlecloud/storage/scaladsl/GCStorageWiremockBase.scala index 44049de4a2..17b50628a4 100644 --- a/google-cloud-storage/src/test/scala/akka/stream/alpakka/googlecloud/storage/scaladsl/GCStorageWiremockBase.scala +++ b/google-cloud-storage/src/test/scala/akka/stream/alpakka/googlecloud/storage/scaladsl/GCStorageWiremockBase.scala @@ -23,7 +23,7 @@ import scala.util.Random abstract class GCStorageWiremockBase(_system: ActorSystem, _wireMockServer: Hoverfly) extends TestKit(_system) { def this(mock: Hoverfly) = - this(ActorSystem(getCallerName(getClass), + this(ActorSystem(getCallerName(classOf[GCStorageWiremockBase]), config(mock.getHoverflyConfig.getProxyPort).withFallback(ConfigFactory.load())), mock) diff --git a/google-common/src/main/scala/akka/stream/alpakka/google/auth/ComputeEngineCredentials.scala b/google-common/src/main/scala/akka/stream/alpakka/google/auth/ComputeEngineCredentials.scala index 8946b57bcb..e29f91cc4f 100644 --- a/google-common/src/main/scala/akka/stream/alpakka/google/auth/ComputeEngineCredentials.scala +++ b/google-common/src/main/scala/akka/stream/alpakka/google/auth/ComputeEngineCredentials.scala @@ -10,6 +10,7 @@ import akka.stream.Materializer import akka.stream.alpakka.google.RequestSettings import java.time.Clock +import scala.annotation.unused import scala.concurrent.Future @InternalApi @@ -26,7 +27,7 @@ private[auth] object ComputeEngineCredentials { private final class ComputeEngineCredentials(projectId: String)(implicit mat: Materializer) extends OAuth2Credentials(projectId) { override protected def getAccessToken()(implicit mat: Materializer, - settings: RequestSettings, + @unused settings: RequestSettings, clock: Clock): Future[AccessToken] = GoogleComputeMetadata.getAccessToken() } diff --git a/google-common/src/main/scala/akka/stream/alpakka/google/auth/NoCredentials.scala b/google-common/src/main/scala/akka/stream/alpakka/google/auth/NoCredentials.scala index 7e0651e959..8b37369b5d 100644 --- a/google-common/src/main/scala/akka/stream/alpakka/google/auth/NoCredentials.scala +++ b/google-common/src/main/scala/akka/stream/alpakka/google/auth/NoCredentials.scala @@ -11,6 +11,7 @@ import com.typesafe.config.Config import java.net.URI import java.util +import scala.annotation.unused import scala.concurrent.{ExecutionContext, Future} @InternalApi @@ -25,10 +26,11 @@ private[auth] final case class NoCredentials private (projectId: String, token: private val futureToken = Future.successful(OAuth2BearerToken(token)) - override def get()(implicit ec: ExecutionContext, settings: RequestSettings): Future[OAuth2BearerToken] = + override def get()(implicit @unused ec: ExecutionContext, + @unused settings: RequestSettings): Future[OAuth2BearerToken] = futureToken - override def asGoogle(implicit ec: ExecutionContext, settings: RequestSettings): GoogleCredentials = + override def asGoogle(implicit @unused ec: ExecutionContext, @unused settings: RequestSettings): GoogleCredentials = new GoogleCredentials { override def getAuthenticationType: String = "" override def getRequestMetadata(uri: URI): util.Map[String, util.List[String]] = util.Collections.emptyMap() diff --git a/google-common/src/main/scala/akka/stream/alpakka/google/auth/OAuth2Credentials.scala b/google-common/src/main/scala/akka/stream/alpakka/google/auth/OAuth2Credentials.scala index 7ccc83a765..b020af6be7 100644 --- a/google-common/src/main/scala/akka/stream/alpakka/google/auth/OAuth2Credentials.scala +++ b/google-common/src/main/scala/akka/stream/alpakka/google/auth/OAuth2Credentials.scala @@ -14,6 +14,7 @@ import akka.stream.{CompletionStrategy, Materializer, OverflowStrategy} import com.google.auth.{Credentials => GoogleCredentials} import java.time.Clock +import scala.annotation.unused import scala.concurrent.{ExecutionContext, Future, Promise} @InternalApi @@ -28,7 +29,7 @@ private[auth] abstract class OAuth2Credentials(val projectId: String)(implicit m private val tokenStream = stream.run() - override def get()(implicit ec: ExecutionContext, settings: RequestSettings): Future[OAuth2BearerToken] = { + override def get()(implicit @unused ec: ExecutionContext, settings: RequestSettings): Future[OAuth2BearerToken] = { val token = Promise[OAuth2BearerToken]() tokenStream ! TokenRequest(token, settings) token.future diff --git a/google-common/src/main/scala/akka/stream/alpakka/google/auth/UserAccessCredentials.scala b/google-common/src/main/scala/akka/stream/alpakka/google/auth/UserAccessCredentials.scala index 08bd0d730e..4666ae7799 100644 --- a/google-common/src/main/scala/akka/stream/alpakka/google/auth/UserAccessCredentials.scala +++ b/google-common/src/main/scala/akka/stream/alpakka/google/auth/UserAccessCredentials.scala @@ -13,6 +13,7 @@ import spray.json.DefaultJsonProtocol._ import spray.json.{JsonParser, RootJsonFormat} import java.time.Clock +import scala.annotation.unused import scala.concurrent.Future import scala.io.Source @@ -68,7 +69,7 @@ private final class UserAccessCredentials(clientId: String, ) extends OAuth2Credentials(projectId) { override protected def getAccessToken()(implicit mat: Materializer, - settings: RequestSettings, + @unused settings: RequestSettings, clock: Clock): Future[AccessToken] = { UserAccessMetadata.getAccessToken(clientId, clientSecret, refreshToken) } diff --git a/google-common/src/test/scala/akka/stream/alpakka/google/auth/OAuth2CredentialsSpec.scala b/google-common/src/test/scala/akka/stream/alpakka/google/auth/OAuth2CredentialsSpec.scala index 3910053d45..dfb6d50be9 100644 --- a/google-common/src/test/scala/akka/stream/alpakka/google/auth/OAuth2CredentialsSpec.scala +++ b/google-common/src/test/scala/akka/stream/alpakka/google/auth/OAuth2CredentialsSpec.scala @@ -18,6 +18,7 @@ import org.scalatest.wordspec.AnyWordSpecLike import pdi.jwt.JwtTime import java.time.Clock +import scala.annotation.unused import scala.concurrent.{Future, Promise} class OAuth2CredentialsSpec @@ -41,9 +42,9 @@ class OAuth2CredentialsSpec } val testableCredentials = new OAuth2Credentials("dummyProject") { - override protected def getAccessToken()(implicit mat: Materializer, - settings: RequestSettings, - clock: Clock): Future[AccessToken] = + override protected def getAccessToken()(implicit @unused mat: Materializer, + @unused settings: RequestSettings, + @unused clock: Clock): Future[AccessToken] = AccessTokenProvider.accessTokenPromise.future } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index c92fdb22b3..ecec888645 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -5,7 +5,7 @@ object Dependencies { val CronBuild = sys.env.get("GITHUB_EVENT_NAME").contains("schedule") - val Scala213 = "2.13.10" // update even in link-validator.conf + val Scala213 = "2.13.12" // update even in link-validator.conf val Scala3 = "3.3.1" val Scala2Versions = Seq(Scala213) val ScalaVersions = Dependencies.Scala2Versions :+ Dependencies.Scala3 diff --git a/scripts/link-validator.conf b/scripts/link-validator.conf index 8b3f9775d6..1305e1cdeb 100644 --- a/scripts/link-validator.conf +++ b/scripts/link-validator.conf @@ -37,7 +37,7 @@ site-link-validator { "http://www.thedevpiece.com/" # genereated by @apidoc "http://pravega.io/" - "http://www.scala-lang.org/api/2.13.10/scala/concurrent/Future.html" - "http://www.scala-lang.org/api/2.13.10/scala/util/Try.html" + "http://www.scala-lang.org/api/2.13.12/scala/concurrent/Future.html" + "http://www.scala-lang.org/api/2.13.12/scala/util/Try.html" ] }