You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Silence Tai (Jira)" <ji...@apache.org> on 2019/09/09 14:32:00 UTC

[jira] [Updated] (LANG-1488) Possible serialization failed

     [ https://issues.apache.org/jira/browse/LANG-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Silence Tai updated LANG-1488:
------------------------------
    Fix Version/s:     (was: 3.10)
                   4.0

> Possible serialization failed
> -----------------------------
>
>                 Key: LANG-1488
>                 URL: https://issues.apache.org/jira/browse/LANG-1488
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.tuple.*
>            Reporter: Silence Tai
>            Priority: Major
>             Fix For: 4.0
>
>
> *Pair* fails to properly constrain the generic parameters, requiring them to implement the *Serializable* interface, which may cause serialization to fail.
> Example:
> {code:java}
> static class A { }
> @Test
> public void testSerialization() throws Exception {
>         final ImmutablePair<A, String> origPair = ImmutablePair.of(new A(), "foo");
>         final ByteArrayOutputStream baos = new ByteArrayOutputStream();
>         final ObjectOutputStream out = new ObjectOutputStream(baos);
>         out.writeObject(origPair);
>         out.close();
>         baos.close();
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)