We're updating the issue view to help you get more done. 

JarFilter Gradle plugin does not delete some functions that have default parameter values.

Description

JetBrains has made this change for Kotlin >= 1.3.40: KT-30289.

Consider this function from net.corda.core.serialization.SerializationAPI:

1 2 3 4 5 @DeleteForDJVM inline fun <reified T : Any> Blob.deserialize(serializationFactory: SerializationFactory = SerializationFactory.defaultFactory, context: SerializationContext = serializationFactory.defaultContext): T { return this.getBytes(1, this.length().toInt()).deserialize(serializationFactory, context) }

Kotlin will generate two versions of this function in the class’s byte code:

1 2 @DeleteForDJVM fun <T> Blob.deserialize(SerializationFactory, SerializationContext): T

and

1 fun <T> Blob.deserialize$default(SerializationFactory, SerializationContext): T

However, because Kotlin omits the @DeleteForDJVM annotation from the second version, our JarFilter plugin does not realise that the second function also needs to be deleted.

The result is that the function remains in the core-deterministic byte code and breaks the build with errors like these:

1 2 3 4 5 Warning: net.corda.core.serialization.SerializationAPIKt: can't find referenced class java.sql.Blob Warning: net.corda.core.serialization.SerializationAPIKt: can't find referenced class java.sql.Blob Warning: net.corda.core.serialization.SerializationAPIKt: can't find referenced class java.sql.Blob Warning: net.corda.core.serialization.SerializationAPIKt: can't find referenced class java.sql.Blob Warning: net.corda.core.serialization.SerializationAPIKt: can't find referenced class java.sql.Blob

We cannot upgrade to Kotlin >= 1.3.40 until we fix this.

This will be fixed in Corda Gradle plugins 5.0.3.

Status

Assignee

Chris Rankin

Reporter

Chris Rankin

Priority

Medium

Labels

Severity

Medium

Fix versions

None

Ported to...

None

Feature Team

Select team

Time tracking

0m