Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squash compiler warnings #4913

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions check-digit/src/main/scala/hmda/uli/CheckDigitTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import scala.concurrent.duration._

object CheckDigitTest extends App {

implicit val clientSystem = ActorSystem("CheckDigitClient")
implicit val mat = Materializer(clientSystem)
implicit val ec = clientSystem.dispatcher
implicit val clientSystem: akka.actor.ActorSystem = ActorSystem("CheckDigitClient")
implicit val mat: akka.stream.Materializer = Materializer(clientSystem)
implicit val ec: scala.concurrent.ExecutionContextExecutor = clientSystem.dispatcher

val client = CheckDigitServiceClient(GrpcClientSettings.connectToServiceAt("127.0.0.1", 60080).withTls(false))

Expand Down
2 changes: 1 addition & 1 deletion common/src/main/scala/hmda/auth/OAuth2Authorization.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class OAuth2Authorization(logger: Logger, tokenVerifier: TokenVerifier) {
def authorizeVerifiedToken(): Directive1[VerifiedToken] =
withAccessLog
.&(handleRejections(authRejectionHandler))
.&(passToken)
.&(passToken())

def logAccessLog(uri: Uri, token: () => Option[VerifiedToken])(request: HttpRequest)(r: RouteResult): Unit = {
val result = r match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.circe.syntax._

object Institution {

implicit val headers = List("activityYear|lei|agency|institutionType|institutionId2017|taxId|rssd|emailDomains|respondent|parent|assets|otherLenderCode|topHolder|hmdaFiler|quarterlyFiler|quarterlyFilerHasFiledQ1|quarterlyFilerHasFiledQ2|quarterlyFilerHasFiledQ3|notes\n")
implicit val headers: List[String] = List("activityYear|lei|agency|institutionType|institutionId2017|taxId|rssd|emailDomains|respondent|parent|assets|otherLenderCode|topHolder|hmdaFiler|quarterlyFiler|quarterlyFilerHasFiledQ1|quarterlyFilerHasFiledQ2|quarterlyFilerHasFiledQ3|notes\n")

def empty: Institution = Institution(
activityYear = 2018,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class InstitutionCommandsSerializer(system: ExtendedActorSystem) extends Seriali
deleteInstitutionToProtobuf(cmd, resolver).toByteArray
case cmd: AddFiling =>
addFilingToProtobuf(cmd, resolver).toByteArray
case _
case _ =>
throw new IllegalArgumentException(s"Cannot serialize object of type [${o.getClass.getName}]")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class InstitutionEventsSerializer extends SerializerWithStringManifest {
institutionNotExistsToProtobuf(evt).toByteArray
case evt: FilingAdded =>
filingAddedToProtobuf(evt).toByteArray
case _
case _ =>
throw new IllegalArgumentException(s"Cannot serialize object of type [${o.getClass.getName}]")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SubmissionEventsSerializer extends SerializerWithStringManifest {
submissionModifiedToProtobuf(evt).toByteArray
case evt: SubmissionNotExists =>
submissionNotExistsToProtobuf(evt).toByteArray
case _
case _ =>
throw new IllegalArgumentException(s"Cannot serialize object of type [${o.getClass.getName}]")
}

Expand Down
2 changes: 0 additions & 2 deletions common/src/main/scala/hmda/util/CSVConsolidator.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package hmda.util

import cats.implicits._
import com.typesafe.config.ConfigFactory
import hmda.model.filing.submission.SubmissionId

object CSVConsolidator {

Expand Down
6 changes: 4 additions & 2 deletions common/src/test/scala/hmda/parser/filing/ParserFlowSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ import hmda.parser.filing.ParserFlow._
import hmda.parser.filing.lar.LarParserErrorModel.IncorrectNumberOfFieldsLar
import hmda.parser.filing.ts.TsParserErrorModel.IncorrectNumberOfFieldsTs
import org.scalatest.{ MustMatchers, WordSpec }
import akka.stream.Materializer
import akka.actor.ActorSystem

class ParserFlowSpec extends WordSpec with MustMatchers {

implicit val system = ActorSystem()
implicit val materializer = Materializer(system)
implicit val system:ActorSystem = ActorSystem()
implicit val materializer: Materializer = Materializer(system)

val ts = tsGen.sample.getOrElse(TransmittalSheet())
val tsCsv = ts.toCSV + "\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package hmda.dataBrowser.services
import akka.NotUsed
import akka.stream.scaladsl.Source
import hmda.dataBrowser.models._
import hmda.dataBrowser.models.Aggregation._
import hmda.dataBrowser.repositories._
import monix.eval.Task
import org.slf4j.Logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import org.slf4j.LoggerFactory

import scala.concurrent.Future
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext

// $COVERAGE-OFF$
object HmdaAnalyticsApp extends App with TransmittalSheetComponent with LarComponent with SubmissionHistoryComponent {
Expand All @@ -48,12 +49,12 @@ object HmdaAnalyticsApp extends App with TransmittalSheetComponent with LarCompo
| |___/
""".stripMargin)

implicit val system = ActorSystem()
implicit val typedSystem = system.toTyped
implicit val materializer = Materializer(system)
implicit val ec = system.dispatcher
implicit val system:ActorSystem = ActorSystem()
implicit val typedSystem: akka.actor.typed.ActorSystem[Nothing] = system.toTyped
implicit val materializer:Materializer = Materializer(system)
implicit val ec: ExecutionContext = system.dispatcher

implicit val timeout = Timeout(5.seconds)
implicit val timeout: akka.util.Timeout = Timeout(5.seconds)

val kafkaConfig = system.settings.config.getConfig("akka.kafka.consumer")
val config = ConfigFactory.load()
Expand Down
2 changes: 1 addition & 1 deletion hmda-auth/src/main/scala/api/AuthHttpApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import com.typesafe.config.ConfigFactory
import slick.basic.DatabaseConfig
import slick.jdbc.JdbcProfile

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.concurrent._
import scala.concurrent.Future
import scala.util.{ Failure, Success}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object HmdaDataPublisherApp extends App with PGTableNameLoader {
""".stripMargin
)

implicit val actorSystem = ActorSystem("hmda-data-publisher")
implicit val actorSystem: akka.actor.ActorSystem = ActorSystem("hmda-data-publisher")
implicit val ec: ExecutionContext = actorSystem.dispatcher
val config = actorSystem.settings.config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ trait LoanLimitLarHeader {

object LoanLimitHeader extends LoanLimitLarHeader {
def getHeaderString = {
LoanLimitHeader
this.LoanLimitHeader
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class CombinedMLarPublicScheduler(publishingReporter: ActorRef[PublishingReporte
with PublicAWSConfigLoader
with PrivateAWSConfigLoader {

implicit val ec = context.system.dispatcher
implicit val materializer = Materializer(context)
implicit val ec: scala.concurrent.ExecutionContextExecutor = context.system.dispatcher
implicit val materializer: akka.stream.Materializer = Materializer(context)

val availableRepos: Map[Int, ModifiedLarRepository] = mLarAvailableYears.map(yr => yr -> {
val component = new PublisherComponent(yr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class LarPublicScheduler(publishingReporter: ActorRef[PublishingReporter.Command
with PublicAWSConfigLoader
with PrivateAWSConfigLoader {

implicit val ec = context.system.dispatcher
implicit val materializer = Materializer(context)
implicit val ec: scala.concurrent.ExecutionContextExecutor = context.system.dispatcher
implicit val materializer: akka.stream.Materializer = Materializer(context)

val availableRepos: Map[Int, ModifiedLarRepository] = mLarAvailableYears.map(yr => yr -> {
val component = new PublisherComponent(yr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class LarScheduler(publishingReporter: ActorRef[PublishingReporter.Command], sch
with LoanLimitLarHeader
with PrivateAWSConfigLoader {

implicit val ec = context.system.dispatcher
implicit val materializer = Materializer(context)
implicit val ec: scala.concurrent.ExecutionContextExecutor = context.system.dispatcher
implicit val materializer: akka.stream.Materializer = Materializer(context)
private val fullDate = DateTimeFormatter.ofPattern("yyyy-MM-dd-")
private val fullDateQuarterly = DateTimeFormatter.ofPattern("yyyy-MM-dd_")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class TsPublicScheduler(publishingReporter: ActorRef[PublishingReporter.Command]
with PublicAWSConfigLoader
with PrivateAWSConfigLoader {

implicit val ec = context.system.dispatcher
implicit val materializer = Materializer(context)
implicit val ec: scala.concurrent.ExecutionContextExecutor = context.system.dispatcher
implicit val materializer: akka.stream.Materializer = Materializer(context)

val availableRepos = tsAvailableYears.map(year => year -> {
val component = new PublisherComponent(year)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class TsScheduler(publishingReporter: ActorRef[PublishingReporter.Command], sche
with PublisherComponent2023
with PrivateAWSConfigLoader {

implicit val ec = context.system.dispatcher
implicit val materializer = Materializer(context)
implicit val ec: scala.concurrent.ExecutionContextExecutor = context.system.dispatcher
implicit val materializer: akka.stream.Materializer = Materializer(context)
private val fullDate = DateTimeFormatter.ofPattern("yyyy-MM-dd-")
private val fullDateQuarterly = DateTimeFormatter.ofPattern("yyyy-MM-dd_")

Expand Down Expand Up @@ -207,7 +207,7 @@ class TsScheduler(publishingReporter: ActorRef[PublishingReporter.Command], sche
}


def reportPublishingResult( schedule: Schedule, fullFilePath: String,count: Option[Int]) {
def reportPublishingResult( schedule: Schedule, fullFilePath: String,count: Option[Int]): Unit = {

publishingReporter ! FilePublishingCompleted(
schedule,
Expand All @@ -218,7 +218,7 @@ class TsScheduler(publishingReporter: ActorRef[PublishingReporter.Command], sche
log.info(s"Pushed to S3: $bucketPrivate/$fullFilePath.")
}

def reportPublishingResultError( schedule: Schedule, fullFilePath: String,message:Throwable) {
def reportPublishingResultError( schedule: Schedule, fullFilePath: String,message:Throwable): Unit = {
publishingReporter ! FilePublishingCompleted(
schedule,
fullFilePath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ object HmdaQuarterlyDataApi {
implicit val mat: Materializer = Materializer(ctx)
implicit val ec: ExecutionContext = ctx.executionContext
implicit val dbConfig: DatabaseConfig[JdbcProfile] = DatabaseConfig.forConfig[JdbcProfile]("db")
val log = ctx.log
val config = system.settings.config
val host: String = config.getString("server.bindings.address")
val port: Int = config.getInt("server.bindings.port")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import akka.http.scaladsl.server.Route
import hmda.model.filing.lar.enums._
import hmda.quarterly.data.api.dao.repo.QuarterlyGraphRepo
import hmda.quarterly.data.api.dto.QuarterGraphData.{GraphRoute, GraphSeriesInfo, GraphSeriesSummary}
import hmda.quarterly.data.api.route.counts.loans.Loans.{CATEGORY, LOAN_LABEL, LOAN_VOLUME_SUBTITLE, LOAN_VOLUME_TITLE, LOAN_VOLUME_TITLE_HOME}
import hmda.quarterly.data.api.route.counts.loans.Loans.{CATEGORY, LOAN_LABEL, LOAN_VOLUME_SUBTITLE, LOAN_VOLUME_TITLE_HOME}
import hmda.quarterly.data.api.route.lib.Verbiage.COUNT_DECIMAL_PRECISION
import hmda.quarterly.data.api.route.lib.Verbiage.LoanType._
import hmda.quarterly.data.api.serde.JsonSupport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ abstract class RatesGraph(
protected def getSummaryByRace(title: String, race: String): CancelableFuture[GraphSeriesSummary] = ???
protected def decimalPlaces: Int = DEFAULT_DECIMAL_PRECISION
def getRoute: GraphRoute = new GraphRoute(title, categoryVerbiage, endpoint) {
override def route: Route = pathPrefix(endpoint) {
override def route: Route = pathPrefix(this.endpoint) {
path("") {
complete(
getSummary
Expand Down
4 changes: 2 additions & 2 deletions hmda/src/main/scala/hmda/HmdaPlatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ object HmdaPlatform extends App {
implicit val classic: ClassicActorSystem = ClassicActorSystem(clusterConfig.getString("hmda.cluster.name"), clusterConfig)
implicit val system: ActorSystem[_] = classic.toTyped

implicit val mat = Materializer(system)
implicit val cluster = Cluster(system)
implicit val mat: akka.stream.Materializer = Materializer(system)
implicit val cluster: akka.cluster.typed.Cluster = Cluster(system)

if (runtimeMode == "dcos" || runtimeMode == "kubernetes" || runtimeMode == "docker-compose" || runtimeMode == "kind") {
ClusterBootstrap(system).start()
Expand Down
4 changes: 2 additions & 2 deletions hmda/src/main/scala/hmda/api/http/filing/FilingHttpApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private class FilingHttpApi(log: Logger, sharding: ClusterSharding)(implicit val
} ~
// GET/institutions/<lei>/filings/<year>
(get & extractUri) { uri =>
parameter('page.as[Int] ? 1)(pageNumber => getFilingForInstitution(lei, year, None, uri, pageNumber))
parameter(Symbol("page").as[Int] ? 1)(pageNumber => getFilingForInstitution(lei, year, None, uri, pageNumber))
}
}
}
Expand All @@ -71,7 +71,7 @@ private class FilingHttpApi(log: Logger, sharding: ClusterSharding)(implicit val
} ~
// GET /institutions/<lei>/filings/<year>/quarters/<quarter>
(get & extractUri) { uri =>
parameter('page.as[Int] ? 1)(pageNumber => getFilingForInstitution(lei, period, Option(quarter), uri, pageNumber))
parameter(Symbol("page").as[Int] ? 1)(pageNumber => getFilingForInstitution(lei, period, Option(quarter), uri, pageNumber))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private class EditsHttpApi(log: Logger, sharding: ClusterSharding)(
val editNameRegex: Regex = new Regex("""[SVQ]\d\d\d(?:-\d)?""")
pathPrefix("institutions" / Segment) { lei =>
(extractUri & get) { uri =>
parameters('page.as[Int] ? 1) { page =>
parameters(Symbol("page").as[Int] ? 1) { page =>
oAuth2Authorization.authorizeTokenWithLei(lei) { _ =>
path("filings" / IntNumber / "submissions" / IntNumber / "edits" / editNameRegex) { (year, seqNr, editName) =>
getEditDetails(lei, year, None, seqNr, page, editName, uri)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private class ParseErrorHttpApi(log: Logger, sharding: ClusterSharding)(implicit
// GET institutions/<lei>/filings/<year>/submissions/<submissionId>/parseErrors
// GET institutions/<lei>/filings/<year>/quarter/<q>/submissions/<submissionId>/parseErrors
def parseErrorPath(oauth2Authorization: OAuth2Authorization): Route = (extractUri & get) { uri =>
parameters('page.as[Int] ? 1) { page =>
parameters(Symbol("page").as[Int] ? 1) { page =>
pathPrefix("institutions" / Segment / "filings" / IntNumber) { (lei, year) =>
oauth2Authorization.authorizeTokenWithLei(lei) { _ =>
path("submissions" / IntNumber / "parseErrors") { seqNr =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private class HmdaFileValidationHttpApi(implicit mat: Materializer) {
private val validateYearRoute =
path("validate" / IntNumber ) { year =>
post {
parameters('check.as[String] ? "all") { checkType =>
parameters(Symbol("check").as[String] ? "all") { checkType =>
fileUpload("file") {
case (_, byteSource) =>
val processF =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private class LarValidationHttpApi {
//lar/validate/<year>
private val validateYearLarRoute =
path("validate" / IntNumber) { year =>
parameters('check.as[String] ? "all") { checkType =>
parameters(Symbol("check").as[String] ? "all") { checkType =>
post {
respondWithHeader(RawHeader("Cache-Control", "no-cache")) {
entity(as[LarValidateRequest]) { req =>
Expand All @@ -61,7 +61,7 @@ private class LarValidationHttpApi {
//lar/validate/<year>
private val validateQuarterLarRoute =
path("validate" / IntNumber / "quarter" / Quarter) { (year, quarter) =>
parameters('check.as[String] ? "all") { checkType =>
parameters(Symbol("check").as[String] ? "all") { checkType =>
post {
respondWithHeader(RawHeader("Cache-Control", "no-cache")) {
entity(as[LarValidateRequest]) { req =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private class TsValidationHttpApi {
//ts/validate/<year>
private val validateYearTsRoute =
path("validate" / IntNumber) { year =>
parameters('check.as[String] ? "all") { checkType =>
parameters(Symbol("check").as[String] ? "all") { checkType =>
post {
respondWithHeader(RawHeader("Cache-Control", "no-cache")) {
entity(as[TsValidateRequest]) { req =>
Expand All @@ -62,7 +62,7 @@ private class TsValidationHttpApi {
// $COVERAGE-OFF$
private val validateQuarterTsRoute =
path("validate" / IntNumber / "quarter" / Quarter) { (year, quarter) =>
parameters('check.as[String] ? "all") { checkType =>
parameters(Symbol("check").as[String] ? "all") { checkType =>
post {
respondWithHeader(RawHeader("Cache-Control", "no-cache")) {
entity(as[TsValidateRequest]) { req =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.context.ValidationContext
import hmda.validation.rules.lar.quality._2019._
import hmda.validation.rules.lar.validity.common.V619_2
import hmda.validation.rules.lar.quality.{_2020 => quality2020, _2021 => quality2021, _2022 => quality2022, _2025 => quality2025}
import hmda.validation.rules.lar.quality.{_2020 => quality2020, _2021 => quality2021, _2022 => quality2022}
import hmda.validation.rules.lar.quality.common._
import hmda.validation.rules.lar.syntactical.{S300, S301}
import hmda.validation.rules.lar.validity.{_2020, _2022, _2024, _}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package hmda.validation.engine
import hmda.model.filing.ts.TransmittalLar
import hmda.validation.context.ValidationContext
import hmda.validation.rules.lar.syntactical.{S307}
import hmda.validation.engine.TsLarEngine2025

// $COVERAGE-OFF$
private[engine] object TsLarEngine2025Q extends ValidationEngine[TransmittalLar] {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import scala.concurrent.{ ExecutionContext, Future }

object ValidationFlow extends ColumnDataFormatter {

implicit val larSemigroup = new Semigroup[LoanApplicationRegister] {
implicit val larSemigroup: cats.Semigroup[hmda.model.filing.lar.LoanApplicationRegister] = new Semigroup[LoanApplicationRegister] {
override def combine(x: LoanApplicationRegister, y: LoanApplicationRegister): LoanApplicationRegister =
x
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ import hmda.model.filing.lar.LoanApplicationRegister
import hmda.parser.filing.ts.TsCsvParser.toValidBigDecimal
import hmda.validation.dsl.ValidationResult
import hmda.validation.rules.EditCheck
import hmda.validation.dsl.PredicateHmda._
import hmda.validation.dsl.PredicateCommon._
import hmda.validation.dsl.PredicateSyntax._

import scala.util.Try


object Q616_3 extends EditCheck[LoanApplicationRegister] {
override def name: String = "Q616-3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package hmda.validation.rules.lar.quality._2025

import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.dsl.PredicateCommon._
import hmda.validation.dsl.PredicateHmda._
import hmda.validation.dsl.PredicateSyntax._
import hmda.validation.dsl.{ValidationFailure, ValidationResult, ValidationSuccess}
import hmda.validation.dsl.ValidationResult
import hmda.validation.rules.EditCheck


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package hmda.validation.rules.lar.quality._2025
import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.dsl.PredicateCommon._
import hmda.validation.dsl.PredicateSyntax._
import hmda.validation.dsl.{ValidationFailure, ValidationResult}
import hmda.validation.dsl.ValidationResult
import hmda.validation.rules.EditCheck

import scala.util.Try
Expand Down
Loading
Loading