You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dan Ziemba (Jira)" <ji...@apache.org> on 2023/07/29 16:08:00 UTC

[jira] [Commented] (LANG-1704) ImmutablePair and ImmutableTriple implementation don't match final in Javadoc

    [ https://issues.apache.org/jira/browse/LANG-1704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17748837#comment-17748837 ] 

Dan Ziemba commented on LANG-1704:
----------------------------------

I'd argue that removing final was already breaking change. Existing code that depends on the semantics of ImmutablePair can not safely upgrade to 3.13.0 because those semantics have now changed. If your use case requires extending the class, why not either:
 * Start with MutablePair
 * Just write a custom class
 * For tests, use a mocking framework such as Mockito that can mock final classes.

> ImmutablePair and ImmutableTriple implementation don't match final in Javadoc
> -----------------------------------------------------------------------------
>
>                 Key: LANG-1704
>                 URL: https://issues.apache.org/jira/browse/LANG-1704
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.tuple.*
>    Affects Versions: 3.13.0
>            Reporter: Dan Ziemba
>            Priority: Minor
>             Fix For: 3.13.1
>
>
> As of commons-lang3 3.13.0, the ImmutablePair and ImmutableTriple classes are no longer final, even though their javadocs claim that they are. This is a problem because you can now subclass those and, for example, make an effectively mutable object that could be passed to a method with a parameter of type ImmutablePair.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)