Closed skyecodes closed 6 months ago
Yes, that is related to my change adding kotlinx-collections-immutable support. It now probably requires you to have it on your classpath :unamused: I will have a look directly :+1:
Fixed with release 3.2.0
Thanks for the quick fix!
Hello,
I'm trying to map a
List<A>
to aList<B>
but it doesn't seem to be working. I'm using this for example:When building with Gradle the
kspKotlin
task fails with an error (stacktrace below). I could reproduce the error using Kotlin 1.9.23, KSP 1.0.20 and Konvert 3.1.0. It works fine with 3.0.1 so I suppose this is a bug introduced in the latest version.Stacktrace
``` e: [ksp] java.lang.NullPointerException at io.mcarle.konvert.converter.IterableToXConverter$targetClassDeclaration$2.invoke(IterableToXConverter.kt:65) at io.mcarle.konvert.converter.IterableToXConverter$targetClassDeclaration$2.invoke(IterableToXConverter.kt:65) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at io.mcarle.konvert.converter.IterableToXConverter.getTargetClassDeclaration(IterableToXConverter.kt:65) at io.mcarle.konvert.converter.IterableToXConverter.access$getTargetClassDeclaration(IterableToXConverter.kt:37) at io.mcarle.konvert.converter.IterableToXConverter$targetType$2.invoke(IterableToXConverter.kt:67) at io.mcarle.konvert.converter.IterableToXConverter$targetType$2.invoke(IterableToXConverter.kt:67) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at io.mcarle.konvert.converter.IterableToXConverter.getTargetType(IterableToXConverter.kt:67) at io.mcarle.konvert.converter.IterableToXConverter.access$getTargetType(IterableToXConverter.kt:37) at io.mcarle.konvert.converter.IterableToXConverter$matches$1.invoke(IterableToXConverter.kt:75) at io.mcarle.konvert.converter.IterableToXConverter$matches$1.invoke(IterableToXConverter.kt:73) at io.mcarle.konvert.converter.api.AbstractTypeConverter.handleNullable(AbstractTypeConverter.kt:22) at io.mcarle.konvert.converter.IterableToXConverter.matches(IterableToXConverter.kt:73) at io.mcarle.konvert.processor.codegen.MappingCodeGenerator$convertValue$1.invoke(MappingCodeGenerator.kt:237) at io.mcarle.konvert.processor.codegen.MappingCodeGenerator$convertValue$1.invoke(MappingCodeGenerator.kt:236) at io.mcarle.konvert.converter.api.TypeConverterRegistry.withAdditionallyEnabledConverters(TypeConverterRegistry.kt:47) at io.mcarle.konvert.processor.codegen.MappingCodeGenerator.convertValue(MappingCodeGenerator.kt:236) at io.mcarle.konvert.processor.codegen.MappingCodeGenerator.constructorParamsCode(MappingCodeGenerator.kt:118) at io.mcarle.konvert.processor.codegen.MappingCodeGenerator.constructorCode(MappingCodeGenerator.kt:80) at io.mcarle.konvert.processor.codegen.MappingCodeGenerator.generateMappingCode(MappingCodeGenerator.kt:35) at io.mcarle.konvert.processor.codegen.CodeGenerator.generateCode(CodeGenerator.kt:69) at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator.generateMappingCode(KonverterCodeGenerator.kt:109) at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator.access$generateMappingCode(KonverterCodeGenerator.kt:22) at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator$generate$1$1$1$1.invoke(KonverterCodeGenerator.kt:74) at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator$generate$1$1$1$1.invoke(KonverterCodeGenerator.kt:39) at io.mcarle.konvert.converter.api.config.ConfigurationKt.withIsolatedConfiguration(Configuration.kt:54) at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator$generate$1.invoke(KonverterCodeGenerator.kt:39) at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator$generate$1.invoke(KonverterCodeGenerator.kt:28) at io.mcarle.konvert.converter.api.config.ConfigurationKt.withIsolatedConfiguration(Configuration.kt:54) at io.mcarle.konvert.processor.konvert.KonverterCodeGenerator.generate(KonverterCodeGenerator.kt:28) at io.mcarle.konvert.processor.KonvertProcessor.generateMappingCode(KonvertProcessor.kt:71) at io.mcarle.konvert.processor.KonvertProcessor.access$generateMappingCode(KonvertProcessor.kt:24) at io.mcarle.konvert.processor.KonvertProcessor$process$1.invoke(KonvertProcessor.kt:42) at io.mcarle.konvert.processor.KonvertProcessor$process$1.invoke(KonvertProcessor.kt:33) at io.mcarle.konvert.converter.api.config.ConfigurationKt.withIsolatedConfiguration(Configuration.kt:42) at io.mcarle.konvert.processor.KonvertProcessor.process(KonvertProcessor.kt:33) at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:310) at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:308) at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:414) at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:308) at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:112) at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:77) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:256) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:247) at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:247) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:87) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:43) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:165) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:50) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:104) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:48) at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101) at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1523) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197) at java.base/java.security.AccessController.doPrivileged(AccessController.java:714) at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:598) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:844) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:721) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:720) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583) ```