Skip to content

Commit e9253ef

Browse files
committed
Revert Iterable Plugin checking
1 parent b77e320 commit e9253ef

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

komm-plugins-iterable/src/main/kotlin/com/ucasoft/komm/plugins/iterable/IterablePlugin.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import com.google.devtools.ksp.symbol.KSPropertyDeclaration
55
import com.google.devtools.ksp.symbol.KSType
66
import com.squareup.kotlinpoet.LIST
77
import com.squareup.kotlinpoet.ksp.toClassName
8-
import com.squareup.kotlinpoet.ksp.toTypeName
98

109
class IterablePlugin: BaseIterablePlugin() {
1110

@@ -22,14 +21,14 @@ class IterablePlugin: BaseIterablePlugin() {
2221
val destinationParam = destinationType.arguments.first()
2322
val sourceParam = sourceType.arguments.first()
2423
val stringBuilder = StringBuilder(sourceName)
25-
var fromCastDeclaration = sourceType.declaration.qualifiedName?.asString()
24+
var fromCastDeclaration = sourceType.toClassName()
2625
val (sourceIsNullable, destinationIsNullOrNullSubstitute) = parseMappingData(sourceType, sourceProperty, destinationType, destinationProperty)
2726
stringBuilder.append(addSafeNullCall(sourceIsNullable, safeCallOrNullAssertion(destinationIsNullOrNullSubstitute)))
2827
if (!destinationParam.type!!.resolve().isAssignableFrom(sourceParam.type!!.resolve())) {
2928
stringBuilder.append(".map{ it.to${destinationParam.type}() }")
30-
fromCastDeclaration = LIST.canonicalName
29+
fromCastDeclaration = LIST
3130
}
32-
if (destinationType.declaration.qualifiedName?.asString() != fromCastDeclaration) {
31+
if (!destinationType.toClassName().isAssignableFrom(fromCastDeclaration)) {
3332
stringBuilder.append("${addSafeNullCall(sourceIsNullable && destinationIsNullOrNullSubstitute)}.to${destinationType.toClassName().simpleName}()")
3433
}
3534
return stringBuilder.toString().trimEnd('?')

komm-plugins-iterable/src/main/kotlin/com/ucasoft/komm/plugins/iterable/IterableStringPlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class IterableStringPlugin: BaseIterablePlugin() {
3535
stringBuilder.append(")")
3636
} else {
3737
stringBuilder.append(".split(\"$delimiter\")")
38-
if (destinationType.declaration.qualifiedName?.asString() != LIST.canonicalName) {
38+
if (!destinationType.toClassName().isAssignableFrom(LIST)) {
3939
stringBuilder.append("${addSafeNullCall(sourceIsNullable && destinationIsNullOrNullSubstitute)}.to${destinationType.toClassName().simpleName}()")
4040
}
4141
}

0 commit comments

Comments
 (0)