Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 如何避免或修复与Int vs Integer相关的Kotlin警告_Spring Boot_Kotlin - Fatal编程技术网

Spring boot 如何避免或修复与Int vs Integer相关的Kotlin警告

Spring boot 如何避免或修复与Int vs Integer相关的Kotlin警告,spring-boot,kotlin,Spring Boot,Kotlin,我有一个SpringBoot2.0.0/Kotlin/Gradle项目。 我在注入整数时收到警告。我知道答案,但不知道答案。有没有更好的方法来注入这些@Values? 谢谢 警告: \src\main\kotlin\com\tech\stands\PicturesDownloader.kt: (22, 31): This class shouldn't be used in Kotlin. Use kotlin.Int instead. 代码: 如果无法修复,是否有方法抑制它?如果要抑制它,可

我有一个SpringBoot2.0.0/Kotlin/Gradle项目。 我在注入整数时收到警告。我知道答案,但不知道答案。有没有更好的方法来注入这些
@Value
s? 谢谢

警告:

\src\main\kotlin\com\tech\stands\PicturesDownloader.kt: (22, 31): This class shouldn't be used in Kotlin. Use kotlin.Int instead.
代码:


如果无法修复,是否有方法抑制它?

如果要抑制它,可以使用以下注释:

@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")

我不熟悉Spring Boot和价值注入系统,所以我不确定这是否有效。将该值设置为0,使用
Int
并删除lateinit。因为它仍然是一个var,所以在创建之后仍然可以设置它,这意味着一旦创建了类,值注入应该能够设置它

@Value("\${cache.adpics.concurrent}")
var MAX_CONCURRENT: Int = 0

也就是说:
'lateinit'modifier不允许在基元类型的属性上使用
@Value("\${cache.adpics.concurrent}")
var MAX_CONCURRENT: Int = 0