You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2026/07/20 17:55:00 UTC
[jira] [Comment Edited] (HDDS-15908) Disallow using Apache Commons Pair
[ 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: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org