Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version = 3.11.1
runner.dialect = scala213
runner.dialect = scala213source3
project.git = true
style = defaultWithAlign
docstrings.style = Asterisk
Expand Down Expand Up @@ -80,3 +80,13 @@ fileOverride = {
runner.dialect = scala3
}
}

rewrite.scala3.convertToNewSyntax = true
runner {
dialectOverride {
allowSignificantIndentation = false
allowAsForImportRename = false
allowStarWildcardImport = false
allowPostfixStarVarargSplices = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ trait GrpcServerProvider {
def label: String
def pendingCases: Set[String]

def server: GrpcServer[_]
def server: GrpcServer[?]
}

trait GrpcClientProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ class PekkoGrpcScalaClientTester(val settings: Settings, backend: String, testWi
def timeoutOnSleepingServer(): Unit =
throw new RuntimeException("Not implemented!timeoutOnSleepingServer") with NoStackTrace

def assertFailure(failure: Future[_], expectedStatus: Status): Unit = {
def assertFailure(failure: Future[?], expectedStatus: Status): Unit = {
val throwable = Await.result(failure.failed, awaitTimeout)
throwable shouldBe a[StatusRuntimeException]
assertEquals(expectedStatus.getCode, throwable.asInstanceOf[StatusRuntimeException].getStatus.getCode)
}

def assertFailure(failure: Future[_], expectedStatus: Status, expectedMessage: String): Unit = {
def assertFailure(failure: Future[?], expectedStatus: Status, expectedMessage: String): Unit = {
val throwable = Await.result(failure.failed, awaitTimeout)
throwable shouldBe a[StatusRuntimeException]
val e = throwable.asInstanceOf[StatusRuntimeException]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class GrpcMarshallingSpec extends AnyWordSpec with Matchers {
assertFailure(GrpcMarshalling.unmarshal(request), Status.Code.INTERNAL, "encoding")
}

def assertFailure(failure: Future[_], expectedStatusCode: Status.Code, expectedMessageFragment: String): Unit = {
def assertFailure(failure: Future[?], expectedStatusCode: Status.Code, expectedMessageFragment: String): Unit = {
val e = Await.result(failure.failed, awaitTimeout).asInstanceOf[StatusException]
e.getStatus.getCode should be(expectedStatusCode)
e.getStatus.getDescription should include(expectedMessageFragment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import scala.concurrent.duration._
import scala.concurrent.{ ExecutionContext, Future }

// #stateful-service
class GreeterServiceImpl(greeterActor: ActorRef[GreeterActor.GreetingCommand])(implicit system: ActorSystem[_])
class GreeterServiceImpl(greeterActor: ActorRef[GreeterActor.GreetingCommand])(implicit system: ActorSystem[?])
extends GreeterService {

def sayHello(in: HelloRequest): Future[HelloReply] = {
Expand Down
2 changes: 1 addition & 1 deletion project/ReflectiveCodeGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object ReflectiveCodeGen extends AutoPlugin {
// needed to be able to override the PB.generate task reliably
override lazy val requires = ProtocPlugin

override lazy val projectSettings: Seq[Def.Setting[_]] =
override lazy val projectSettings: Seq[Def.Setting[?]] =
inConfig(Compile)(
Seq(
PB.protocOptions := protocOptions.value,
Expand Down
2 changes: 1 addition & 1 deletion project/SbtMavenPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object SbtMavenPlugin extends AutoPlugin {

import autoImport._

override lazy val projectSettings: Seq[Setting[_]] = inConfig(Compile)(unscopedSettings)
override lazy val projectSettings: Seq[Setting[?]] = inConfig(Compile)(unscopedSettings)

lazy val unscopedSettings =
Seq(
Expand Down
2 changes: 1 addition & 1 deletion project/VersionGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import sbt._
*/
object VersionGenerator {

lazy val settings: Seq[Setting[_]] = inConfig(Compile)(
lazy val settings: Seq[Setting[?]] = inConfig(Compile)(
Seq(
resourceGenerators += generateVersion(resourceManaged, _ / "pekko-grpc-version.conf",
"""|pekko.grpc.version = "%s"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object GrpcProtocolNative extends AbstractGrpcProtocol("grpc") {
headers = headers,
entity = HttpEntity(contentType, encodeDataToFrameBytes(codec, data)),
protocol = HttpProtocols.`HTTP/1.1`,
attributes = Map.empty[AttributeKey[_], Any].updated(AttributeKeys.trailer, trailer))
attributes = Map.empty[AttributeKey[?], Any].updated(AttributeKeys.trailer, trailer))

private def encodeDataToFrameBytes(codec: Codec, data: ByteString): ByteString =
AbstractGrpcProtocol.encodeFrameData(codec.compress(data), codec.isCompressed, isTrailer = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object GrpcResponseHelpers {
private val TrailerOk = GrpcEntityHelpers.trailer(Status.OK)
private val TrailerOkAttribute = Trailer(TrailerOk.trailers)
private val TrailerOkAttributes =
Map.empty[AttributeKey[_], Any].updated(AttributeKeys.trailer, TrailerOkAttribute)
Map.empty[AttributeKey[?], Any].updated(AttributeKeys.trailer, TrailerOkAttribute)
private val IdentityResponseHeaders: immutable.Seq[HttpHeader] =
headers.`Message-Encoding`(Identity.name) :: Nil

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ object GrpcMarshalling {
eHandler: JFunction[ActorSystem, JFunction[Throwable, Trailers]]): CompletionStage[HttpResponse] =
try {
response match {
case future: CompletableFuture[_] if future.isDone =>
case future: CompletableFuture[?] if future.isDone =>
try completedResponse(marshal(completedValue[Out](future), m, writer, system, eHandler))
catch {
case NonFatal(error) => handleUnaryFailure(error, writer, system, eHandler)
Expand Down Expand Up @@ -157,6 +157,6 @@ object GrpcMarshalling {
case NonFatal(error) => failure(error)
}

private def completedValue[T](future: CompletableFuture[_]): T =
private def completedValue[T](future: CompletableFuture[?]): T =
future.asInstanceOf[CompletableFuture[T]].getNow(null.asInstanceOf[T])
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ private[grpc] final class GrpcImpl(system: ExtendedActorSystem) extends Extensio
private[grpc] object Grpc extends ExtensionId[GrpcImpl] with ExtensionIdProvider {
override def createExtension(system: ExtendedActorSystem): GrpcImpl = new GrpcImpl(system)

override def lookup: ExtensionId[_ <: Extension] = Grpc
override def lookup: ExtensionId[? <: Extension] = Grpc
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ChannelUtilsSpec extends AnyWordSpec with Matchers with ScalaFutures {
// CONNECTING => FAILURE
fakeChannel.runCallBack()
promiseReady.isCompleted shouldEqual true
promiseReady.future.value.get shouldBe a[Failure[_]]
promiseReady.future.value.get shouldBe a[Failure[?]]
promiseReady.future.failed.value.get.get.getMessage should startWith("Unable to establish connection")
}

Expand Down Expand Up @@ -140,7 +140,7 @@ class ChannelUtilsSpec extends AnyWordSpec with Matchers with ScalaFutures {
promiseReady.isCompleted shouldEqual true
promiseDone.isCompleted shouldEqual true

promiseDone.future.value.get shouldBe a[Failure[_]]
promiseDone.future.value.get shouldBe a[Failure[?]]
promiseDone.future.failed.value.get.get.getMessage should startWith("Unable to establish connection")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class PekkoHttpClientUtilsSpec extends TestKit(ActorSystem()) with AnyWordSpecLi
new HttpResponse(
OK,
responseHeaders,
Map.empty[AttributeKey[_], Any].updated(AttributeKeys.trailer, responseTrailers),
Map.empty[AttributeKey[?], Any].updated(AttributeKeys.trailer, responseTrailers),
Strict(GrpcProtocolNative.contentType, ByteString.empty),
HttpProtocols.`HTTP/1.1`))
val source = PekkoHttpClientUtils.responseToSource(response, null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ class PekkoGrpcClientTester(val settings: Settings)(implicit system: ActorSystem
throw new RuntimeException("Not implemented!timeoutOnSleepingServer") with NoStackTrace
}

def assertFailure(failure: Future[_], expectedStatus: Status): Unit = {
def assertFailure(failure: Future[?], expectedStatus: Status): Unit = {
val e = Await.result(failure.failed, awaitTimeout).asInstanceOf[StatusRuntimeException]
assertEquals(expectedStatus.getCode, e.getStatus.getCode)
}

def assertFailure(failure: Future[_], expectedStatus: Status, expectedMessage: String): Unit = {
def assertFailure(failure: Future[?], expectedStatus: Status, expectedMessage: String): Unit = {
val e = Await.result(failure.failed, awaitTimeout).asInstanceOf[StatusRuntimeException]
assertEquals(expectedStatus.getCode, e.getStatus.getCode)
assertEquals(expectedMessage, e.getStatus.getDescription)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object ProtocGoPlugin extends AutoPlugin {

override def requires: Plugins = ProtocPlugin

override def projectSettings: Seq[Def.Setting[_]] =
override def projectSettings: Seq[Def.Setting[?]] =
Seq(Compile, Test).flatMap(inConfig(_)(
Seq(
PB.targets += PB.gens.go -> resourceManaged.value / "go")))
Expand Down
Loading