This is an automated email from the ASF dual-hosted git repository.
fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-grpc.git
The following commit(s) were added to refs/heads/main by this push:
new f20624d6 add nowarn annotations due to compiler warnings (#497)
f20624d6 is described below
commit f20624d6e3b115774a08f7074f034599c57a2224
Author: PJ Fanning <[email protected]>
AuthorDate: Thu Sep 4 04:52:17 2025 +0100
add nowarn annotations due to compiler warnings (#497)
* add nowarn annotations due to compiler warnings
* Update Common.scala
* Update Common.scala
---
project/Common.scala | 3 ++-
.../org/apache/pekko/grpc/javadsl/GrpcExceptionHandler.scala | 10 +++++++---
.../scala/org/apache/pekko/grpc/javadsl/GrpcMarshalling.scala | 2 ++
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/project/Common.scala b/project/Common.scala
index cc363ece..ba528431 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -68,7 +68,8 @@ object Common extends AutoPlugin {
"-Wconf:msg=Use
`scala.jdk.CollectionConverters` instead:silent",
"-Wconf:msg=Use LazyList instead of
Stream:silent",
// ignore imports in templates (FIXME why
is that trailing .* needed?)
- "-Wconf:src=.*.txt.*:silent")
+ "-Wconf:src=.*.txt.*:silent",
+ "-Wconf:cat=unused-nowarn:silent")
else
Seq(
// Generated code for methods/fields
marked 'deprecated'
diff --git
a/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcExceptionHandler.scala
b/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcExceptionHandler.scala
index 65b890f1..9992da2b 100644
---
a/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcExceptionHandler.scala
+++
b/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcExceptionHandler.scala
@@ -14,28 +14,30 @@
package org.apache.pekko.grpc.javadsl
import java.util.concurrent.CompletionException
+
import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.actor.ClassicActorSystemProvider
import pekko.annotation.ApiMayChange
import pekko.annotation.InternalApi
+import pekko.event.Logging
import pekko.grpc.{ GrpcServiceException, Trailers }
import pekko.grpc.GrpcProtocol.GrpcProtocolWriter
import pekko.grpc.internal.{ GrpcMetadataImpl, GrpcResponseHelpers,
MissingParameterException }
import pekko.http.javadsl.model.HttpResponse
+import pekko.http.scaladsl.model.http2.PeerClosedStreamException
import pekko.japi.{ Function => jFunction }
import io.grpc.{ Status, StatusRuntimeException }
-import org.apache.pekko.http.scaladsl.model.http2.PeerClosedStreamException
-
+import scala.annotation.nowarn
import scala.concurrent.ExecutionException
-import pekko.event.Logging
@ApiMayChange
object GrpcExceptionHandler {
private val INTERNAL = Trailers(Status.INTERNAL)
private val INVALID_ARGUMENT = Trailers(Status.INVALID_ARGUMENT)
+ @nowarn("msg=deprecated")
def defaultMapper: jFunction[ActorSystem, jFunction[Throwable, Trailers]] =
new jFunction[ActorSystem, jFunction[Throwable, Trailers]] {
override def apply(system: ActorSystem): jFunction[Throwable, Trailers] =
@@ -45,6 +47,7 @@ object GrpcExceptionHandler {
private def log(system: ActorSystem) = Logging(system,
"org.apache.pekko.grpc.javadsl.GrpcExceptionHandler")
/** INTERNAL API */
+ @nowarn("msg=deprecated")
@InternalApi
private def default(system: ActorSystem): jFunction[Throwable, Trailers] =
new jFunction[Throwable, Trailers] {
@@ -73,6 +76,7 @@ object GrpcExceptionHandler {
def standard(t: Throwable, writer: GrpcProtocolWriter, system:
ClassicActorSystemProvider): HttpResponse =
standard(t, default, writer, system)
+ @nowarn("msg=deprecated")
def standard(
t: Throwable,
mapper: jFunction[ActorSystem, jFunction[Throwable, Trailers]],
diff --git
a/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcMarshalling.scala
b/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcMarshalling.scala
index 7cc812e8..2b09bee9 100644
--- a/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcMarshalling.scala
+++ b/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcMarshalling.scala
@@ -78,6 +78,7 @@ object GrpcMarshalling {
reader: GrpcProtocolReader): CompletionStage[Source[T, NotUsed]] =
unmarshalStream(entity.getDataBytes, u, mat, reader)
+ @nowarn("msg=deprecated")
def marshal[T](
e: T,
m: ProtobufSerializer[T],
@@ -87,6 +88,7 @@ object GrpcMarshalling {
: HttpResponse =
GrpcResponseHelpers.responseForSingleElement(e,
scalaAnonymousPartialFunction(eHandler))(m, writer, system)
+ @nowarn("msg=deprecated")
def marshalStream[T](
e: Source[T, NotUsed],
m: ProtobufSerializer[T],
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]