[Lombok] Fix support of Iterable field marked with @Singular
^KT-53647 Fixed
This commit is contained in:
committed by
teamcity
parent
4ab79ed97d
commit
06119a4670
@@ -56,7 +56,7 @@ object LombokNames {
|
|||||||
).map { FqName(it) }.toSet()
|
).map { FqName(it) }.toSet()
|
||||||
|
|
||||||
private val SUPPORTED_JAVA_COLLECTIONS = setOf(
|
private val SUPPORTED_JAVA_COLLECTIONS = setOf(
|
||||||
"java.util.Iterable",
|
"java.lang.Iterable",
|
||||||
"java.util.Collection",
|
"java.util.Collection",
|
||||||
"java.util.List",
|
"java.util.List",
|
||||||
"java.util.Set",
|
"java.util.Set",
|
||||||
|
|||||||
+11
-2
@@ -21,6 +21,7 @@ import lombok.Singular;
|
|||||||
@Data
|
@Data
|
||||||
public class Other {
|
public class Other {
|
||||||
@Singular("singleSome") private java.util.List<Integer> some;
|
@Singular("singleSome") private java.util.List<Integer> some;
|
||||||
|
@Singular private java.lang.Iterable<String> names;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FILE: test.kt
|
// FILE: test.kt
|
||||||
@@ -35,16 +36,24 @@ fun box(): String {
|
|||||||
|
|
||||||
val user = userBuilder.build()
|
val user = userBuilder.build()
|
||||||
|
|
||||||
val outer = Other.builder()
|
val other = Other.builder()
|
||||||
.withSingleSome(1)
|
.withSingleSome(1)
|
||||||
.withSome(listOf(2, 3))
|
.withSome(listOf(2, 3))
|
||||||
|
.withName("John")
|
||||||
|
.withNames(setOf("Peter"))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
val expectedNumbers = mapOf("1" to 1, "2" to 2, "3" to 3)
|
val expectedNumbers = mapOf("1" to 1, "2" to 2, "3" to 3)
|
||||||
val expectedStatuses = listOf("hello", "world", "!")
|
val expectedStatuses = listOf("hello", "world", "!")
|
||||||
val expectedSome = listOf(1, 2, 3)
|
val expectedSome = listOf(1, 2, 3)
|
||||||
|
val expectedNames = listOf("John", "Peter")
|
||||||
|
|
||||||
return if (user.numbers == expectedNumbers && user.statuses == expectedStatuses && outer.some == expectedSome) {
|
return if (
|
||||||
|
user.numbers == expectedNumbers &&
|
||||||
|
user.statuses == expectedStatuses &&
|
||||||
|
other.some == expectedSome &&
|
||||||
|
other.names == expectedNames
|
||||||
|
) {
|
||||||
"OK"
|
"OK"
|
||||||
} else {
|
} else {
|
||||||
"Error: $user"
|
"Error: $user"
|
||||||
|
|||||||
Reference in New Issue
Block a user