mirror of
https://github.com/corda/corda.git
synced 2025-06-23 09:25:36 +00:00
[CORDA-481]: GH 965: Java 8 lambdas don't work properly in checkpointing (#1619)
This commit is contained in:
committed by
GitHub
parent
246ab26d30
commit
63168c0299
@ -10,6 +10,8 @@ UNRELEASED
|
||||
Release 1.0
|
||||
-----------
|
||||
|
||||
* Java 8 lambdas now work property with Kryo during check-pointing.
|
||||
|
||||
* String constants have been marked as ``const`` type in Kotlin, eliminating cases where functions of the form
|
||||
``get<constant name>()`` were created for the Java API. These can now be referenced by their name directly.
|
||||
|
||||
|
@ -38,6 +38,10 @@ It's reproduced here as an example of both ways you can do this for a couple of
|
||||
.. note:: Several of the core interfaces at the heart of Corda are already annotated and so any classes that implement
|
||||
them will automatically be whitelisted. This includes `Contract`, `ContractState` and `CommandData`.
|
||||
|
||||
.. warning:: Java 8 Lambda expressions are not serializable except in flow checkpoints, and then not by default. The syntax to declare a serializable Lambda
|
||||
expression that will work with Corda is ``Runnable r = (Runnable & Serializable) () -> System.out.println("Hello World");``, or
|
||||
``Callable<String> c = (Callable<String> & Serializable) () -> "Hello World";``.
|
||||
|
||||
.. warning:: We will be replacing the use of Kryo in the serialization framework and so additional changes here are
|
||||
likely.
|
||||
|
||||
|
Reference in New Issue
Block a user