Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

minor cleanup #568

Merged
merged 3 commits into from Nov 15, 2017
Merged

minor cleanup #568

merged 3 commits into from Nov 15, 2017

Conversation

epeee
Copy link
Contributor

@epeee epeee commented Nov 14, 2017

  • get rid of unused imports
  • make use of IOUtil.close
  • get rid of output variable

Copy link
Member

@mockitoguy mockitoguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider my feedback!

Thank you for cleanup!

fos.write(buf, 0, n);
}
} finally {
close(fos);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If close() fails with IOException, we are losing the original exception.

Perhaps we need 2 methods: "close()" and "closeQuietly()".

I know that this problem was present before... since you are changing the code now, let's improve it :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

} catch (IOException e) {
throw new RuntimeException(e);
}
close(input);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also swallow the original exception.

@epeee epeee merged commit 0525aa4 into master Nov 15, 2017
@epeee epeee deleted the ep5 branch November 15, 2017 07:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants