【发布时间】:2018-09-03 06:17:57
【问题描述】:
我有一个 Spring Boot 2.0.0 / Kotlin / Gradle 项目。
注入整数时出现警告。我知道reason,但不知道解决方法。有没有更好的方法来注入这些@Values?
谢谢
警告:
\src\main\kotlin\com\tech\stands\PicturesDownloader.kt: (22, 31): This class shouldn't be used in Kotlin. Use kotlin.Int instead.
代码:
abstract class PicturesDownloader {
@Value("\${cache.adpics.concurrent}")
lateinit var MAX_CONCURRENT: Integer
@Value("\${cache.adpics.max}")
lateinit var MAX_AD_PICS: Integer
}
如果没有办法解决,有没有办法抑制它?
【问题讨论】:
-
那会说:
'lateinit' modifer is not allowed on properties of primitive types
标签: spring-boot kotlin