Skip to content

Commit 64c2fe5

Browse files
committed
1 parent e364515 commit 64c2fe5

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

project/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
group=org.babyfish.jimmer
2-
version=0.9.98
2+
version=0.9.99

project/jimmer-ksp/src/main/kotlin/org/babyfish/jimmer/ksp/immutable/generator/ValidationGenerator.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,6 @@ class ValidationGenerator(
2424
prop.validationAnnotationMirrorMultiMap
2525

2626
fun generate() {
27-
val nullityAnnotations = prop.annotations {
28-
val shortName = it.shortName.asString()
29-
shortName == "NotNull" || shortName == "NonNull" ||
30-
shortName == "Nullable" || shortName == "Null" ||
31-
it.fullName == TNullable::class.qualifiedName
32-
}
33-
if (nullityAnnotations.isNotEmpty()) {
34-
throw MetaException(
35-
prop.propDeclaration,
36-
null,
37-
"it cannot be decorated by that annotation " +
38-
"'@${nullityAnnotations[0].fullName}', " +
39-
"kotlin decides the nullity of property by language, not by annotation"
40-
)
41-
}
4227
generateNotEmpty()
4328
generateNotBlank()
4429
generateSize()

project/jimmer-ksp/src/main/kotlin/org/babyfish/jimmer/ksp/immutable/generator/utils.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private fun KSAnnotation.toAnnotationSpecWithoutSiteTarget(): AnnotationSpec =
130130
toAnnotationSpec().toBuilder().useSiteTarget(null).build()
131131

132132
private fun KSDeclaration.forFun(): Boolean =
133-
this.qualifiedName!!.asString().let { annoTypeName ->
133+
this.qualifiedName?.asString()?.let { annoTypeName ->
134134
annotations
135135
.firstOrNull { it.fullName == Target::class.qualifiedName }
136136
?.getEnumListArgument(Target::allowedTargets)
@@ -146,5 +146,4 @@ private fun KSDeclaration.forFun(): Boolean =
146146
}
147147
?.contains(ElementType.METHOD)
148148
?.takeIf { it }
149-
?: false
150-
}
149+
} ?: false

0 commit comments

Comments
 (0)