You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2023/10/13 10:44:00 UTC

[jira] [Commented] (IO-817) Please don't "force" using builders

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

Gary D. Gregory commented on IO-817:
------------------------------------

The large set of constructors has been deprecated but you can still use them in this major release line.

Builders allow us to maintain less code and are easier to read when a constructor has many parameters.

> Please don't "force" using builders
> -----------------------------------
>
>                 Key: IO-817
>                 URL: https://issues.apache.org/jira/browse/IO-817
>             Project: Commons IO
>          Issue Type: Wish
>            Reporter: Andreas Loth
>            Priority: Major
>
> Commit 7ecca22f175c644da3096940a4ce899be5b33740 deprecates a whole bunch of constructors in favor of using builders.
> So the rather short code
> {code:java}
>         try (StringWriter sw = new StringWriter();
>                 WriterOutputStream wos = new WriterOutputStream(sw, StandardCharsets.UTF_8)) {
> {code}
> expands to a very verbose
> {code:java}
>         try (StringWriter sw = new StringWriter();
>                 WriterOutputStream wos = WriterOutputStream.builder().setCharset(StandardCharsets.UTF_8).setWriter(sw).get()) {
> {code}



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