Skip to content

Commit

Permalink
chore: remove warnings filters (#1757)
Browse files Browse the repository at this point in the history
* chore: remove warnings filters
* Keep names shorter
  • Loading branch information
ennru authored Jul 8, 2024
1 parent f18e6e9 commit 300e7ff
Show file tree
Hide file tree
Showing 40 changed files with 44 additions and 52 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/check-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ jobs:
fail-fast: false
matrix:
include:
- { scalaVersion: '2.13', java-version: 'temurin:1.11', sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { scalaVersion: '2.13', java-version: 'temurin:1.21', sbt-opts: '' }
- { scalaVersion: '3.3', java-version: 'temurin:1.21', sbt-opts: '' }
- { name: "Scala 2.13, JDK 11", scalaVersion: '2.13', java-version: 'temurin:1.11', sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { name: "Scala 2.13, JDK 21", scalaVersion: '2.13', java-version: 'temurin:1.21', sbt-opts: '' }
- { name: "Scala 3.3, JDK 21", scalaVersion: '3.3', java-version: 'temurin:1.21', sbt-opts: '' }
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import javax.management.{Attribute, MBeanServerConnection, ObjectName}

import scala.concurrent.duration.{FiniteDuration, _}
import scala.concurrent.{ExecutionContext, Future}
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

private[benchmarks] trait InflightMetrics {
import InflightMetrics._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.apache.kafka.clients.consumer.{OffsetAndMetadata, OffsetCommitCallbac
import org.apache.kafka.common.TopicPartition

import scala.annotation.tailrec
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

object KafkaConsumerBenchmarks extends LazyLogging {
val pollTimeoutMs: Duration = Duration.ofMillis(50L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import akka.kafka.benchmarks.app.RunTestCommand
import org.apache.kafka.clients.consumer.{ConsumerConfig, KafkaConsumer}
import org.apache.kafka.common.serialization.{ByteArrayDeserializer, StringDeserializer}

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

case class KafkaConsumerTestFixture(topic: String, msgCount: Int, consumer: KafkaConsumer[Array[Byte], String]) {
def close(): Unit = consumer.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.apache.kafka.clients.producer.{Callback, ProducerRecord, RecordMetada
import org.apache.kafka.common.TopicPartition

import scala.annotation.tailrec
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.concurrent.duration.FiniteDuration

object KafkaTransactionBenchmarks extends LazyLogging {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import org.apache.kafka.common.serialization.{
StringSerializer
}

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

case class KafkaTransactionTestFixture(sourceTopic: String,
sinkTopic: String,
Expand Down
14 changes: 3 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ val commonSettings = Def.settings(
"-encoding",
"UTF-8", // yes, this is 2 args
"-release",
"11",
"-Wconf:cat=feature:w,cat=deprecation&msg=.*JavaConverters.*:s,cat=unchecked:w,cat=lint:w,cat=unused:w,cat=w-flag:w"
"11"
) ++ {
if (scalaVersion.value != Scala3) Seq("-Werror")
else Seq.empty
Expand Down Expand Up @@ -170,9 +169,9 @@ lazy val `alpakka-kafka` =
.disablePlugins(SitePlugin, MimaPlugin, CiReleasePlugin)
.settings(commonSettings)
.settings(
crossScalaVersions := Nil,
publish / skip := true,
// TODO: add clusterSharding to unidocProjectFilter when we drop support for Akka 2.5
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(core, testkit),
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(core, testkit, clusterSharding),
onLoadMessage :=
"""
|** Welcome to the Alpakka Kafka connector! **
Expand Down Expand Up @@ -405,10 +404,3 @@ lazy val benchmarks = project
"org.scalatest" %% "scalatest" % scalatestVersion % IntegrationTest
)
)

val isJdk11orHigher: Boolean = {
val result = VersionNumber(sys.props("java.specification.version")).matchesSemVer(SemanticSelector(">=11"))
if (!result)
throw new IllegalArgumentException("JDK 11 or higher is required")
result
}
2 changes: 1 addition & 1 deletion core/src/main/scala/akka/kafka/ConsumerMessage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ object ConsumerMessage {
* Create an offset batch out of a list of offsets.
*/
def createCommittableOffsetBatch[T <: Committable](offsets: java.util.List[T]): CommittableOffsetBatch = {
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
CommittableOffsetBatch(offsets.asScala.toList)
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/akka/kafka/ConsumerSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import com.typesafe.config.Config
import org.apache.kafka.clients.consumer.{Consumer, ConsumerConfig, KafkaConsumer}
import org.apache.kafka.common.serialization.Deserializer

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.compat.java8.OptionConverters._
import scala.compat.java8.FutureConverters._
import scala.concurrent.{ExecutionContext, Future}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/akka/kafka/Metadata.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import akka.actor.NoSerializationVerificationNeeded
import org.apache.kafka.clients.consumer.{OffsetAndMetadata, OffsetAndTimestamp}
import org.apache.kafka.common.{PartitionInfo, TopicPartition}

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.util.Try

/**
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/akka/kafka/ProducerMessage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import akka.NotUsed
import org.apache.kafka.clients.producer.{ProducerRecord, RecordMetadata}

import scala.collection.immutable
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

/**
* Classes that are used in both [[javadsl.Producer]] and
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/akka/kafka/ProducerSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.typesafe.config.Config
import org.apache.kafka.clients.producer.{KafkaProducer, Producer, ProducerConfig}
import org.apache.kafka.common.serialization.Serializer

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.compat.java8.OptionConverters._
import scala.concurrent.duration._
import akka.util.JavaDurationConverters._
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/akka/kafka/Subscriptions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import akka.kafka.internal.PartitionAssignmentHelpers.EmptyPartitionAssignmentHa
import org.apache.kafka.common.TopicPartition

import scala.annotation.varargs
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

sealed trait Subscription {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import akka.annotation.InternalApi
import com.typesafe.config.{Config, ConfigObject}

import scala.annotation.tailrec
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.concurrent.duration.Duration
import akka.util.JavaDurationConverters._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import akka.annotation.InternalApi
import org.apache.kafka.clients.consumer.{Consumer, ConsumerRecords, OffsetAndMetadata}
import org.apache.kafka.common.TopicPartition

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

/**
* Maintain our own OffsetAndTimestamp which can tolerate negative timestamps, which happen for old clients that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import akka.kafka.internal.KafkaConsumerActor.Internal.Seek
import org.apache.kafka.clients.consumer.{ConsumerRecord, ConsumerRecords, OffsetAndMetadata}
import org.apache.kafka.common.TopicPartition

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

/**
* Added as part of https://github.com/akka/alpakka-kafka/issues/1286 to avoid reprocessing data in case of Kafka
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import akka.stream.stage.GraphStageLogic
import akka.util.Timeout
import org.apache.kafka.common.{Metric, MetricName}

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.compat.java8.FutureConverters.{CompletionStageOps, FutureOps}
import scala.concurrent.{ExecutionContext, Future, Promise}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import org.apache.kafka.common.errors.{
}
import org.apache.kafka.common.{Metric, MetricName, TopicPartition}
import scala.annotation.nowarn
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.duration._
import scala.util.{Success, Try}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.apache.kafka.common.requests.OffsetFetchResponse

import scala.compat.java8.FutureConverters.FutureOps
import scala.concurrent.Future
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

/** Internal API */
@InternalApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import akka.kafka.{AutoSubscription, RestrictedConsumer, TopicPartitionsAssigned
import akka.stream.stage.AsyncCallback
import org.apache.kafka.common.TopicPartition

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

/**
* Internal API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.apache.kafka.common.errors.ProducerFencedException

import scala.concurrent.Future
import scala.concurrent.duration._
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.util.{Failure, Try}

/**
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/akka/kafka/javadsl/Consumer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import akka.{Done, NotUsed}
import org.apache.kafka.clients.consumer.ConsumerRecord
import org.apache.kafka.common.{Metric, MetricName, TopicPartition}

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.compat.java8.FutureConverters._
import scala.concurrent.duration.FiniteDuration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import org.apache.kafka.common.{PartitionInfo, TopicPartition}

import scala.compat.java8.FutureConverters._
import scala.concurrent.ExecutionContextExecutor
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

class MetadataClient private (metadataClient: akka.kafka.scaladsl.MetadataClient) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import akka.kafka.ProducerMessage
import org.apache.kafka.clients.producer.{ProducerRecord, RecordMetadata}
import org.apache.kafka.common.TopicPartition

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.collection.immutable

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import org.apache.kafka.clients.consumer.ConsumerConfig
import org.apache.kafka.common.serialization.{Deserializer, Serializer, StringDeserializer, StringSerializer}
import org.slf4j.Logger

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

/**
* Common functions for scaladsl and javadsl Testkit.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.testcontainers.containers.GenericContainer
import org.testcontainers.utility.DockerImageName

import scala.compat.java8.OptionConverters._
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

object TestcontainersKafka {
trait Spec extends KafkaSpec {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import org.slf4j.{Logger, LoggerFactory}
import scala.collection.immutable
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext, Future}
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.util.Try

abstract class KafkaSpec(_kafkaPort: Int, val zooKeeperPort: Int, actorSystem: ActorSystem)
Expand Down
2 changes: 1 addition & 1 deletion tests/src/it/scala/akka/kafka/IntegrationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.apache.kafka.common.TopicPartition
import org.slf4j.Logger
import org.testcontainers.containers.GenericContainer

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

object IntegrationTests {
val MessageLogInterval = 500L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import org.slf4j.{Logger, LoggerFactory}

import scala.collection.immutable
import scala.concurrent.duration._
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.concurrent.ExecutionContext

class CommittingProducerSinkSpec(_system: ActorSystem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import org.mockito.stubbing.Answer
import org.mockito.verification.VerificationMode
import org.mockito.{ArgumentMatchers, Mockito}

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.collection.immutable.Seq
import scala.concurrent.duration._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.mockito.Mockito
import org.scalatest.flatspec.AnyFlatSpecLike
import org.scalatest.matchers.should.Matchers

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.language.reflectiveCalls

class ConsumerProgressTrackingSpec extends AnyFlatSpecLike with Matchers with LogCapturing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.slf4j.{Logger, LoggerFactory}

import java.util.Optional
import scala.concurrent.duration._
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

class ConsumerResetProtectionSpec
extends TestKit(ActorSystem("ConsumerResetProtectionSpec"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.scalatest.matchers.should.Matchers
import scala.collection.immutable.Seq
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext, Future}
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

object ConsumerSpec {
type K = String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.slf4j.{Logger, LoggerFactory}

import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.duration._
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

class PartitionedSourceSpec(_system: ActorSystem)
extends TestKit(_system)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import org.scalatest.matchers.should.Matchers
import java.util.Optional
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext, Future, Promise}
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.util.{Failure, Success, Try}

object ProducerSpec {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.scalatest.Inside
import org.slf4j.{Logger, LoggerFactory}

import scala.concurrent.duration._
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.util.Random

class RebalanceSpec extends SpecBase with TestcontainersKafkaLike with Inside {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import akka.stream.testkit.scaladsl.TestSink

import scala.concurrent.Await
import scala.concurrent.duration._
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

class RetentionPeriodSpec extends SpecBase with TestcontainersKafkaPerClassLike {
private final val confluentPlatformVersion = "5.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.apache.kafka.common.TopicPartition
import org.scalatest.Inside
import org.scalatest.concurrent.IntegrationPatience

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.concurrent.Await
import scala.concurrent.duration._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import ch.qos.logback.core.AppenderBase
* Also clears the buffer..
*/
def flush(): Unit = synchronized {
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
val logbackLogger = getLogbackLogger(classOf[CapturingAppender].getName + "Delegate")
val appenders = logbackLogger.iteratorForAppenders().asScala.filterNot(_ == this).toList
for (event <- buffer; appender <- appenders) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.apache.kafka.clients.producer.ProducerRecord
// #imports
import org.apache.kafka.common.serialization._
// #imports
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

// #schema-registry-settings
class SchemaRegistrySerializationSpec extends DocsSpecBase with TestcontainersKafkaPerClassLike {
Expand Down

0 comments on commit 300e7ff

Please sign in to comment.