Skip to content

Commit

Permalink
fix issues in scala 2.12 build (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning authored Mar 16, 2023
1 parent 4149e20 commit cfd85ad
Show file tree
Hide file tree
Showing 107 changed files with 117 additions and 114 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/check-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,21 @@ jobs:
- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0

- name: ${{ matrix.connector }}
- name: ${{ matrix.connector }} (scala 2.12)
env:
CONNECTOR: ${{ matrix.connector }}
PRE_CMD: ${{ matrix.pre_cmd }}
run: |-
$PRE_CMD
sbt "${CONNECTOR}/test"
sbt +~2.12 "${CONNECTOR}/test"
- name: ${{ matrix.connector }} (scala 2.13)
env:
CONNECTOR: ${{ matrix.connector }}
PRE_CMD: ${{ matrix.pre_cmd }}
run: |-
$PRE_CMD
sbt +~2.13 "${CONNECTOR}/test"
- name: Print logs on failure
if: failure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import javax.net.ssl.{ SSLContext, TrustManager }

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

/**
* Only for internal implementations
Expand Down Expand Up @@ -131,7 +131,7 @@ final class AmqpDetailsConnectionProvider private (
copy(connectionName = Option(name))

override def get: Connection = {
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
val factory = new ConnectionFactory
credentials.foreach { credentials =>
factory.setUsername(credentials.username)
Expand Down Expand Up @@ -339,7 +339,7 @@ final class AmqpConnectionFactoryConnectionProvider private (val factory: Connec
copy(hostAndPorts = hostAndPorts.asScala.map(_.toScala).toIndexedSeq)

override def get: Connection = {
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
factory.newConnection(hostAndPortList.map(hp => new Address(hp._1, hp._2)).asJava)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.util.JavaDurationConverters._

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private trait AmqpConnectorLogic { this: GraphStageLogic =>
connection.addShutdownListener(shutdownListener)
channel.addShutdownListener(shutdownListener)

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

settings.declarations.foreach {
case d: QueueDeclaration =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private[amqp] final class AmqpSourceStage(settings: AmqpSourceSettings, bufferSi
private var unackedMessages = 0

override def whenConnected(): Unit = {
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
channel.basicQos(bufferSize)
val consumerCallback = getAsyncCallback(handleDelivery)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import scala.collection.mutable.Queue
retrieveMessages()

def retrieveMessages(): Unit = {
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
val res = cloudQueueBuilt
.retrieveMessages(settings.batchSize, settings.initialVisibilityTimeout, null, null)
.asScala
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import com.microsoft.azure.storage._
import com.microsoft.azure.storage.queue._
import org.scalatest._

import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.concurrent._
import scala.concurrent.duration._
import scala.util.Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import pekko.actor.{ ClassicActorSystemProvider, ExtendedActorSystem, Extension,
import pekko.annotation.InternalApi
import com.codahale.metrics.MetricRegistry

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

/**
* Retrieves Cassandra metrics registry for an actor system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import java.util.concurrent.{ CompletionStage, Executor }
import java.util.function.{ Function => JFunction }

import scala.annotation.varargs
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.compat.java8.FutureConverters._
import scala.compat.java8.OptionConverters._
import scala.concurrent.ExecutionContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import pekko.stream.connectors.cassandra.CassandraWriteSettings
import pekko.stream.scaladsl.{ Flow, FlowWithContext }
import com.datastax.oss.driver.api.core.cql.{ BatchStatement, BoundStatement, PreparedStatement }

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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package org.apache.pekko.stream.connectors.cassandra.scaladsl

import java.util.concurrent.ConcurrentHashMap

import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import org.apache.pekko
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import pekko.stream.testkit.scaladsl.StreamTestKit.assertAllStagesStopped
import pekko.stream.testkit.scaladsl.TestSink
import com.datastax.oss.driver.api.core.cql.Row

import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.collection.immutable
import scala.compat.java8.FutureConverters._
import scala.compat.java8.OptionConverters._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.datastax.oss.driver.api.core.cql._
import org.scalatest._
import org.scalatest.concurrent.{ PatienceConfiguration, ScalaFutures }

import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.collection.immutable
import scala.concurrent.duration._
import scala.concurrent.{ Await, Future }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.couchbase.client.java.env.CouchbaseEnvironment
import com.couchbase.client.java.{ PersistTo, ReplicateTo }
import com.typesafe.config.Config

import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.collection.immutable
import scala.concurrent.Future
import scala.compat.java8.FutureConverters._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import com.couchbase.client.java.document.{ BinaryDocument, JsonDocument, RawJso
import org.slf4j.LoggerFactory
import play.api.libs.json.Json

import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.collection.immutable.Seq
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient
import software.amazon.awssdk.services.dynamodb.model.TableStatus

import scala.annotation.nowarn
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.concurrent.ExecutionContext

class ItemSpec extends TestKit(ActorSystem("ItemSpec")) with AsyncWordSpecLike with Matchers with BeforeAndAfterAll {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import software.amazon.awssdk.auth.credentials.{ AwsBasicCredentials, StaticCred
import software.amazon.awssdk.regions.Region
import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient

import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpecLike

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package org.apache.pekko.stream.connectors.dynamodb

import software.amazon.awssdk.services.dynamodb.model._

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

trait TestOps {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import pekko.http.scaladsl.model.HttpHeader
import pekko.http.scaladsl.model.HttpHeader.ParsingResult
import pekko.japi.Util

import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import javax.net.ssl.SSLContext
import scala.compat.java8.OptionConverters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import org.apache.pekko
import pekko.NotUsed
import pekko.annotation.InternalApi

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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import pekko.annotation.ApiMayChange
import pekko.stream.connectors.elasticsearch.{ scaladsl, _ }
import com.fasterxml.jackson.databind.ObjectMapper

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

/**
* Java API to create Elasticsearch flows.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import pekko.stream.{ Attributes, Materializer }
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.node.{ ArrayNode, NumericNode }

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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import pekko.stream.javadsl.Sink
import pekko.util.ByteString
import pekko.japi.function

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

import scala.compat.java8.FutureConverters._
Expand Down
2 changes: 1 addition & 1 deletion file/src/test/scala/docs/scaladsl/ArchiveSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.scalatest.concurrent.{ IntegrationPatience, ScalaFutures }
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike

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

class ArchiveSpec
Expand Down
2 changes: 1 addition & 1 deletion file/src/test/scala/docs/scaladsl/TarArchiveSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike

import scala.annotation.nowarn
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.collection.immutable
import scala.concurrent.{ ExecutionContext, Future }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import net.schmizz.sshj.userauth.password.{ PasswordFinder, PasswordUtils, Resou
import net.schmizz.sshj.xfer.FilePermission
import org.apache.commons.net.DefaultSocketFactory

import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.collection.immutable
import scala.util.{ Failure, Try }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions
import com.google.cloud.bigquery.storage.v1.stream.ReadSession
import scalapb.UnknownFieldSet

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

/**
* Internal API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.apache.arrow.vector.util.ByteArrayReadableSeekableByteChannel

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

object ArrowSource {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import pekko.stream.connectors.googlecloud.bigquery.storage.{ scaladsl => scstor
import com.google.cloud.bigquery.storage.v1.arrow.{ ArrowRecordBatch, ArrowSchema }

import java.util.concurrent.CompletionStage
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.compat.java8.FutureConverters.FutureOps

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import com.google.cloud.bigquery.storage.v1.avro.{ AvroRows, AvroSchema }
import com.google.cloud.bigquery.storage.v1.stream.ReadSession.TableReadOptions

import java.util.concurrent.CompletionStage
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.compat.java8.FutureConverters.FutureOps

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.google.cloud.bigquery.storage.v1.stream.ReadSession

import java.util.concurrent.CompletionStage
import scala.compat.java8.FutureConverters.FutureOps
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._

/**
* Google BigQuery Storage Api Akka Stream operator factory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import org.apache.avro.io.DecoderFactory
import java.util
import scala.collection.mutable.ListBuffer
import scala.concurrent.{ ExecutionContext, Future }
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._

class AvroByteStringDecoder(schema: Schema) extends FromByteStringUnmarshaller[java.util.List[BigQueryRecord]] {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.apache.arrow.vector.util.ByteArrayReadableSeekableByteChannel
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
import scala.concurrent.{ ExecutionContext, Future }
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._

class ArrowByteStringDecoder(val schema: ArrowSchema) extends FromByteStringUnmarshaller[List[BigQueryRecord]] {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import java.util.concurrent.CompletionStage
import java.{ lang, util }

import scala.annotation.nowarn
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.compat.java8.FutureConverters._
import scala.compat.java8.OptionConverters._
import scala.concurrent.duration.{ FiniteDuration, MILLISECONDS }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import pekko.stream.connectors.googlecloud.bigquery.scaladsl.spray.BigQueryRestJ
import spray.json.{ JsonFormat, RootJsonFormat }

import java.util
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.collection.immutable.Seq
import scala.compat.java8.OptionConverters._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import spray.json.{ JsonFormat, RootJsonFormat }
import java.util

import scala.annotation.nowarn
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.collection.immutable.Seq
import scala.compat.java8.OptionConverters._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import java.{ lang, util }

import scala.annotation.nowarn
import scala.annotation.unchecked.uncheckedVariance
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.collection.immutable.Seq
import scala.compat.java8.OptionConverters._
import scala.concurrent.duration.FiniteDuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import java.{ lang, util }

import scala.annotation.nowarn
import scala.annotation.unchecked.uncheckedVariance
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._
import scala.collection.immutable.Seq
import scala.compat.java8.OptionConverters._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import scala.annotation.nowarn
import scala.annotation.varargs
import scala.collection.immutable.Seq
import scala.compat.java8.OptionConverters._
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._

/**
* Table resource model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer

import java.time.{ Instant, LocalDate, LocalDateTime, LocalTime }
import scala.jdk.CollectionConverters._
import scala.collection.JavaConverters._

@JsonPropertyOrder(alphabetic = true)
case class A(integer: Int, long: Long, float: Float, double: Double, string: String, boolean: Boolean, record: B) {
Expand Down
Loading

0 comments on commit cfd85ad

Please sign in to comment.