Le 01/11/2024 à 20:04, Gary Gregory a écrit :
Emanuel,
-1 you are duplicating code (again) as a one-off while adding the clutter
of a ternary expression (and unnecessary parentheses). It is much cleaner
to use canonical-like code from our low level Commons IO library we already
use elsewhere. There is no benefit to expanding this API call. This change
forces the reader to parse out the ternary expreasion, the how, instead of
focusing on the what of the method.
Gary,
There are 4 other ternary expressions in the ZipFile class, 90+ in the
zip package and over 270 in the whole code, not counting the unit tests.
Some of these expressions were added by you this year, in commits
labeled "Use ternary expression" [1][2][3]. So I conclude that it's
acceptable to use this syntax.
The extra parentheses improve the readability in my opinion, but I don't
mind removing them.
Expanding the API call is necessary to remove the undesired dependency
on Commons IO.
Emmanuel Bourg
[1] https://github.com/apache/commons-compress/commit/bbe6fd9a
[2] https://github.com/apache/commons-compress/commit/aa71cb93
[3] https://github.com/apache/commons-compress/commit/b3e34e89
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org