mirror of
https://github.com/corda/corda.git
synced 2025-03-10 22:44:20 +00:00
ENT-11264 Fixed initialization of field serializer
This commit is contained in:
parent
b375c7da21
commit
91d4c33513
@ -8272,8 +8272,6 @@ public static final class net.corda.core.utilities.ProgressTracker$STARTING exte
|
|||||||
@NotNull
|
@NotNull
|
||||||
public static final net.corda.core.utilities.ProgressTracker$STARTING INSTANCE
|
public static final net.corda.core.utilities.ProgressTracker$STARTING INSTANCE
|
||||||
##
|
##
|
||||||
public static interface net.corda.core.utilities.ProgressTracker$SerializableAction extends java.io.Serializable, rx.functions.Action1
|
|
||||||
##
|
|
||||||
@CordaSerializable
|
@CordaSerializable
|
||||||
public static class net.corda.core.utilities.ProgressTracker$Step extends java.lang.Object
|
public static class net.corda.core.utilities.ProgressTracker$Step extends java.lang.Object
|
||||||
public <init>(String)
|
public <init>(String)
|
||||||
@ -8297,8 +8295,6 @@ public static final class net.corda.core.utilities.ProgressTracker$UNSTARTED ext
|
|||||||
public interface net.corda.core.utilities.PropertyDelegate
|
public interface net.corda.core.utilities.PropertyDelegate
|
||||||
public abstract T getValue(Object, kotlin.reflect.KProperty)
|
public abstract T getValue(Object, kotlin.reflect.KProperty)
|
||||||
##
|
##
|
||||||
public interface net.corda.core.utilities.SerializableLambda2 extends java.io.Serializable, kotlin.jvm.functions.Function2
|
|
||||||
##
|
|
||||||
public final class net.corda.core.utilities.SgxSupport extends java.lang.Object
|
public final class net.corda.core.utilities.SgxSupport extends java.lang.Object
|
||||||
public static final boolean isInsideEnclave()
|
public static final boolean isInsideEnclave()
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@ -6,7 +6,6 @@ import net.corda.core.flows.StartableByRPC
|
|||||||
import net.corda.core.identity.Party
|
import net.corda.core.identity.Party
|
||||||
import net.corda.core.internal.concurrent.transpose
|
import net.corda.core.internal.concurrent.transpose
|
||||||
import net.corda.core.messaging.startFlow
|
import net.corda.core.messaging.startFlow
|
||||||
import net.corda.core.utilities.SerializableLambda2
|
|
||||||
import net.corda.core.utilities.getOrThrow
|
import net.corda.core.utilities.getOrThrow
|
||||||
import net.corda.core.utilities.minutes
|
import net.corda.core.utilities.minutes
|
||||||
import net.corda.node.services.statemachine.StateTransitionException
|
import net.corda.node.services.statemachine.StateTransitionException
|
||||||
@ -16,6 +15,7 @@ import net.corda.testing.core.singleIdentity
|
|||||||
import net.corda.testing.driver.DriverParameters
|
import net.corda.testing.driver.DriverParameters
|
||||||
import net.corda.testing.driver.driver
|
import net.corda.testing.driver.driver
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
import java.io.Serializable
|
||||||
import java.sql.SQLTransientConnectionException
|
import java.sql.SQLTransientConnectionException
|
||||||
import java.util.concurrent.CompletableFuture
|
import java.util.concurrent.CompletableFuture
|
||||||
import kotlin.test.assertFailsWith
|
import kotlin.test.assertFailsWith
|
||||||
@ -23,6 +23,8 @@ import kotlin.test.assertTrue
|
|||||||
|
|
||||||
class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() {
|
||||||
|
|
||||||
|
private fun interface SerializableLambda2<S, T, R> : (S, T) -> R, Serializable
|
||||||
|
|
||||||
@Test(timeout = 300_000)
|
@Test(timeout = 300_000)
|
||||||
fun `external async operation`() {
|
fun `external async operation`() {
|
||||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||||
|
@ -10,7 +10,6 @@ import net.corda.core.internal.packageName
|
|||||||
import net.corda.core.messaging.startFlow
|
import net.corda.core.messaging.startFlow
|
||||||
import net.corda.core.node.services.queryBy
|
import net.corda.core.node.services.queryBy
|
||||||
import net.corda.core.transactions.TransactionBuilder
|
import net.corda.core.transactions.TransactionBuilder
|
||||||
import net.corda.core.utilities.SerializableLambda2
|
|
||||||
import net.corda.core.utilities.getOrThrow
|
import net.corda.core.utilities.getOrThrow
|
||||||
import net.corda.core.utilities.minutes
|
import net.corda.core.utilities.minutes
|
||||||
import net.corda.testing.contracts.DummyContract
|
import net.corda.testing.contracts.DummyContract
|
||||||
@ -22,12 +21,15 @@ import net.corda.testing.driver.DriverParameters
|
|||||||
import net.corda.testing.driver.driver
|
import net.corda.testing.driver.driver
|
||||||
import net.corda.testing.node.internal.cordappsForPackages
|
import net.corda.testing.node.internal.cordappsForPackages
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
import java.io.Serializable
|
||||||
import java.sql.SQLTransientConnectionException
|
import java.sql.SQLTransientConnectionException
|
||||||
import kotlin.test.assertFailsWith
|
import kotlin.test.assertFailsWith
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
class FlowExternalOperationTest : AbstractFlowExternalOperationTest() {
|
||||||
|
|
||||||
|
private fun interface SerializableLambda2<S, T, R> : (S, T) -> R, Serializable
|
||||||
|
|
||||||
@Test(timeout = 300_000)
|
@Test(timeout = 300_000)
|
||||||
fun `external operation`() {
|
fun `external operation`() {
|
||||||
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) {
|
||||||
|
@ -11,7 +11,6 @@ import net.corda.nodeapi.internal.serialization.kryo.KRYO_CHECKPOINT_CONTEXT
|
|||||||
import net.corda.serialization.internal.CheckpointSerializationContextImpl
|
import net.corda.serialization.internal.CheckpointSerializationContextImpl
|
||||||
import net.corda.testing.core.SerializationEnvironmentRule
|
import net.corda.testing.core.SerializationEnvironmentRule
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.rules.ExpectedException
|
import org.junit.rules.ExpectedException
|
||||||
@ -62,7 +61,6 @@ class KotlinUtilsTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test(timeout=300_000)
|
@Test(timeout=300_000)
|
||||||
@Ignore("TODO JDK17:Fixme serializable lambda issue")
|
|
||||||
fun `checkpointing a transient property with capturing lambda`() {
|
fun `checkpointing a transient property with capturing lambda`() {
|
||||||
val original = CapturingTransientProperty("Hello")
|
val original = CapturingTransientProperty("Hello")
|
||||||
val originalVal = original.transientVal
|
val originalVal = original.transientVal
|
||||||
|
@ -5,7 +5,6 @@ import net.corda.core.internal.uncheckedCast
|
|||||||
import net.corda.core.serialization.CordaSerializable
|
import net.corda.core.serialization.CordaSerializable
|
||||||
import org.slf4j.Logger
|
import org.slf4j.Logger
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
import java.io.Serializable
|
|
||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
import java.util.concurrent.ExecutionException
|
import java.util.concurrent.ExecutionException
|
||||||
import java.util.concurrent.Future
|
import java.util.concurrent.Future
|
||||||
@ -134,6 +133,3 @@ fun <V> Future<V>.getOrThrow(timeout: Duration? = null): V = try {
|
|||||||
} catch (e: ExecutionException) {
|
} catch (e: ExecutionException) {
|
||||||
throw e.cause!!
|
throw e.cause!!
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Functional interfaces for Serializeable Lambdas */
|
|
||||||
fun interface SerializableLambda2<S, T, R> : (S, T) -> R, Serializable
|
|
||||||
|
@ -39,7 +39,7 @@ class ProgressTracker(vararg inputSteps: Step) {
|
|||||||
private val log = contextLogger()
|
private val log = contextLogger()
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun interface SerializableAction<T>: Action1<T>, Serializable
|
private fun interface SerializableAction<T>: Action1<T>, Serializable
|
||||||
|
|
||||||
@CordaSerializable
|
@CordaSerializable
|
||||||
sealed class Change(val progressTracker: ProgressTracker) {
|
sealed class Change(val progressTracker: ProgressTracker) {
|
||||||
|
@ -93,7 +93,10 @@ class CordaClassResolver(serializationContext: CheckpointSerializationContext) :
|
|||||||
val serializer = when {
|
val serializer = when {
|
||||||
objectInstance != null -> KotlinObjectSerializer(objectInstance)
|
objectInstance != null -> KotlinObjectSerializer(objectInstance)
|
||||||
kotlin.jvm.internal.Lambda::class.java.isAssignableFrom(targetType) -> // Kotlin lambdas extend this class and any captured variables are stored in synthetic fields
|
kotlin.jvm.internal.Lambda::class.java.isAssignableFrom(targetType) -> // Kotlin lambdas extend this class and any captured variables are stored in synthetic fields
|
||||||
FieldSerializer<Any>(kryo, targetType).apply { fieldSerializerConfig.ignoreSyntheticFields = false }
|
FieldSerializer<Any>(kryo, targetType).apply {
|
||||||
|
fieldSerializerConfig.ignoreSyntheticFields = false
|
||||||
|
updateFields()
|
||||||
|
}
|
||||||
Throwable::class.java.isAssignableFrom(targetType) -> ThrowableSerializer(kryo, targetType)
|
Throwable::class.java.isAssignableFrom(targetType) -> ThrowableSerializer(kryo, targetType)
|
||||||
else -> maybeWrapForInterning(kryo.getDefaultSerializer(targetType), targetType)
|
else -> maybeWrapForInterning(kryo.getDefaultSerializer(targetType), targetType)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user