[CORDA-481]: GH 965: Java 8 lambdas don't work properly in checkpointing (#1619)

This commit is contained in:
Michele Sollecito
2017-09-26 13:22:59 +01:00
committed by GitHub
parent 246ab26d30
commit 63168c0299
9 changed files with 195 additions and 5 deletions

View File

@ -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.

View File

@ -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.