Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOUtils.close() only accepts Closeable as a vararg which results in unnecessary Object[] created if only one Closeable passed there #1740

Closed
dlg99 opened this issue Oct 5, 2018 · 0 comments
Assignees

Comments

@dlg99
Copy link
Contributor

dlg99 commented Oct 5, 2018

BUG REPORT

  1. Please describe the issue you observed:

IOUtils.close() only accepts Closeable as a vararg which results in unnecessary Object[] created if only one Closeable passed there
100% of close() usage is with only one Closeable.
While it is not very often used (log rotation, shutdown etc) we can still avoid this extra allocation.

@dlg99 dlg99 self-assigned this Oct 5, 2018
dlg99 pushed a commit to dlg99/bookkeeper that referenced this issue Oct 5, 2018
…which results in unnecessary Object[] created if only one Closeable passed there
@sijie sijie closed this as completed in 117ba4d Oct 5, 2018
sijie pushed a commit that referenced this issue Oct 5, 2018
… results in unnecessary Object[] created if only one Closeable passed there

Descriptions of the changes in this PR:

added close() variant that takes one Closeable.

### Motivation

100% of close() usage is with one Closeable.

### Changes

light refactoring.

Master Issue: #1740

Author: Andrey Yegorov <ayegorov@salesforce.com>

Reviewers: Sijie Guo <sijie@apache.org>, Enrico Olivelli <eolivelli@gmail.com>

This closes #1741 from dlg99/nit/ioutils, closes #1740

(cherry picked from commit 117ba4d)
Signed-off-by: Sijie Guo <sijie@apache.org>
sijie pushed a commit that referenced this issue Oct 5, 2018
… results in unnecessary Object[] created if only one Closeable passed there

Descriptions of the changes in this PR:

added close() variant that takes one Closeable.

### Motivation

100% of close() usage is with one Closeable.

### Changes

light refactoring.

Master Issue: #1740

Author: Andrey Yegorov <ayegorov@salesforce.com>

Reviewers: Sijie Guo <sijie@apache.org>, Enrico Olivelli <eolivelli@gmail.com>

This closes #1741 from dlg99/nit/ioutils, closes #1740

(cherry picked from commit 117ba4d)
Signed-off-by: Sijie Guo <sijie@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant