Lambdas and serialization
Alessio Stalla
alessiostalla at gmail.com
Tue Oct 19 06:41:04 PDT 2010
On Tue, Oct 19, 2010 at 3:30 PM, Paul Benedict <pbenedict at apache.org> wrote:
> Will the wrapper be serializable if the SAM interface is? That's a
> good question, but I imagine it has to be because it is implementing
> the interface.
>
> public interface MySamType extends Serializable {
> void doSomething(int x);
> }
Sorry, I was unclear with the expression "be serializable": what I
really meant is not if it will merely implement java.io.Serializable,
rather if it will actually be serialized by an ObjectOutputStream
without any exception in all cases where a "regular" instance of the
SAM would have been serialized without exceptions, and deserialized in
the same conditions as well. That's imho a desirable feature to have,
but it places a possibly non-trivial burden on the implementation.
More information about the lambda-dev
mailing list