Skip to content

Commit d100a7b

Browse files
committed
Spring 5 upgrade
1 parent 4c24627 commit d100a7b

File tree

5 files changed

+6
-98
lines changed

5 files changed

+6
-98
lines changed

project/Commons.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object Commons extends ProjectGroup("commons") {
3131
val scalacheckVersion = "1.16.0"
3232
val jettyVersion = "9.4.51.v20230217"
3333
val mongoVersion = "4.9.1"
34-
val springVersion = "4.3.26.RELEASE"
34+
val springVersion = "5.3.28"
3535
val typesafeConfigVersion = "1.4.2"
3636
val commonsIoVersion = "1.3.2" // test only
3737
val scalaLoggingVersion = "3.9.5"
@@ -341,7 +341,6 @@ object Commons extends ProjectGroup("commons") {
341341
jvmCommonSettings,
342342
libraryDependencies ++= Seq(
343343
"com.google.guava" % "guava" % guavaVersion,
344-
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
345344
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
346345
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
347346
"io.monix" %% "monix" % monixVersion,
@@ -364,6 +363,7 @@ object Commons extends ProjectGroup("commons") {
364363
jvmCommonSettings,
365364
libraryDependencies ++= Seq(
366365
"org.springframework" % "spring-context" % springVersion,
366+
"com.google.code.findbugs" % "jsr305" % jsr305Version % Optional,
367367
),
368368
)
369369

spring/src/main/scala/com/avsystem/commons/spring/HoconBeanDefinitionReader.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class HoconBeanDefinitionReader(registry: BeanDefinitionRegistry)
2020
import com.typesafe.config.ConfigValueType._
2121

2222
private implicit class ConfigValueExtensions(value: ConfigValue) {
23-
def as[T: HoconType] =
23+
def as[T: HoconType]: T =
2424
implicitly[HoconType[T]].get(value)
2525
}
2626

spring/src/main/scala/com/avsystem/commons/spring/HoconType.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import com.typesafe.config._
55

66
trait HoconType[T] {
77

8-
protected def requireNonNull(value: ConfigValue) = {
8+
protected def requireNonNull(value: ConfigValue): ConfigValue = {
99
require(value != null, s"No value found")
1010
value
1111
}

spring/src/main/scala/com/avsystem/commons/spring/ScalaDefaultValuesInjector.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package com.avsystem.commons
22
package spring
33

44
import java.lang.reflect.{Constructor, Method, Modifier}
5-
65
import org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
76
import org.springframework.beans.factory.config.{BeanDefinition, BeanDefinitionHolder, ConfigurableListableBeanFactory}
87
import org.springframework.beans.factory.support._
98
import org.springframework.core.{ParameterNameDiscoverer, StandardReflectionParameterNameDiscoverer}
109

10+
import scala.annotation.tailrec
1111
import scala.beans.BeanProperty
1212
import scala.reflect.{ScalaLongSignature, ScalaSignature}
1313

@@ -48,6 +48,7 @@ class ScalaDefaultValuesInjector extends BeanDefinitionRegistryPostProcessor {
4848
.foreach(n => traverse(registry.getBeanDefinition(n)))
4949
}
5050

51+
@tailrec
5152
private def isScalaClass(cls: Class[_]): Boolean = cls.getEnclosingClass match {
5253
case null => cls.getAnnotation(classOf[ScalaSignature]) != null ||
5354
cls.getAnnotation(classOf[ScalaLongSignature]) != null

spring/src/main/scala/com/avsystem/commons/spring/ScalaParameterNameDiscoverer.scala

-93
This file was deleted.

0 commit comments

Comments
 (0)