From 9c52e57204dfc217fabeb889e4ae570cc05fa5e6 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Wed, 20 Mar 2019 12:11:09 +0100 Subject: [PATCH 1/2] Enable strict scalac options for akka-protobuf Unfortunately it still produces a Java warning, but I see no safe way around that (so we can't just add `-Werror` to javacOptions) --- .../java/akka/persistence/typed/javadsl/LoggerSourceTest.java | 2 +- project/AkkaDisciplinePlugin.scala | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java index 256960407d..1e8e6678a4 100644 --- a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java +++ b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java @@ -16,7 +16,7 @@ import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Test; -import org.scalatestplus.junit.JUnitSuite; +import org.scalatest.junit.JUnitSuite; import java.util.concurrent.atomic.AtomicInteger; diff --git a/project/AkkaDisciplinePlugin.scala b/project/AkkaDisciplinePlugin.scala index 4fefcc6f12..8760bbec03 100644 --- a/project/AkkaDisciplinePlugin.scala +++ b/project/AkkaDisciplinePlugin.scala @@ -24,10 +24,12 @@ object AkkaDisciplinePlugin extends AutoPlugin with ScalafixSupport { val fatalWarningsFor = Set( "akka-discovery", "akka-distributed-data", + "akka-protobuf", ) val strictProjects = Set( "akka-discovery", + "akka-protobuf", ) lazy val scalaFixSettings = Seq( From 72e0e67c3c65290b5e592822e01b3a6010899c29 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Wed, 20 Mar 2019 14:41:37 +0100 Subject: [PATCH 2/2] Remove 'dead' code, bringing the class back in line with upstream --- .../src/main/java/akka/protobuf/AbstractParser.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/akka-protobuf/src/main/java/akka/protobuf/AbstractParser.java b/akka-protobuf/src/main/java/akka/protobuf/AbstractParser.java index 011ff5df74..40b6f2d30a 100644 --- a/akka-protobuf/src/main/java/akka/protobuf/AbstractParser.java +++ b/akka-protobuf/src/main/java/akka/protobuf/AbstractParser.java @@ -114,10 +114,6 @@ public abstract class AbstractParser return message; } catch (InvalidProtocolBufferException e) { throw e; - } catch (IOException e) { - throw new RuntimeException( - "Reading from a ByteString threw an IOException (should " + - "never happen).", e); } } @@ -151,10 +147,6 @@ public abstract class AbstractParser return message; } catch (InvalidProtocolBufferException e) { throw e; - } catch (IOException e) { - throw new RuntimeException( - "Reading from a byte array threw an IOException (should " + - "never happen).", e); } }