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

Tsz-wo Sze edited comment on HDDS-15908 at 7/20/26 5:54 PM:
------------------------------------------------------------

{quote}... "left"/"right" are too generic. This can be mitigated by subclassing 
Pair ...
{quote}
[~adoroszlai], let just create new classes but not subclassing Pair, e.g. 
[HostAndPort|https://github.com/apache/ozone/blob/master/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/net/HostAndPort.java]
 instead of Pair<String, Integer>.
{quote}... the import is used more then 100+ places .
{quote}
[~nakumar], please create subtasks for removing Pair. Thanks.


was (Author: szetszwo):
bq. ... "left"/"right" are too generic. This can be mitigated by subclassing 
Pair ...

[~adoroszlai], let just create new classes but not subclassing Pair, e.g. 
HostAndPort instead of Pair<String, Integer>.

bq. ... the import is used more then 100+ places .

[~nakumar], please create subtasks for removing Pair.  Thanks.



> Disallow using Apache Commons Pair
> ----------------------------------
>
>                 Key: HDDS-15908
>                 URL: https://issues.apache.org/jira/browse/HDDS-15908
>             Project: Apache Ozone
>          Issue Type: Improvement
>            Reporter: Tsz-wo Sze
>            Priority: Major
>         Attachments: image-2026-07-18-12-01-27-484.png
>
>
> As Google suggested:
> {quote}Using the org.apache.commons.lang3.tuple.Pair class from Apache 
> Commons Lang is generally discouraged in modern Java ...
>  - Lack of semantics ...
>  - Code smell (Primitive Obsession) ...
>  - Unnecessary dependency ....{quote}
> !image-2026-07-18-12-01-27-484.png|width=600!



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to