GitHub user mernst opened a pull request:
https://github.com/apache/commons-io/pull/43
Make code style of hasBOM() consistent with getBOMCharsetName()
This is a minor, stylistic patch.
Background fact: After the first call to `getBOM()`, the expressions
`getBOM()` and `byteOrderMark` are equivalent. (This fact isn't documented in
the code, though.)
`getBOMCharsetName()` first calls `getBOM()` for side effect, then uses
`byteOrderMark` within its body.
By contrast, `hasBOM()` mixes the two forms.
This patch changes `hasBOM()` to use the same code style as
`getBOMCharsetName()`. In addition to consistency throughout the file, the
refactored code makes it obvious that there is no null pointer exception,
without the reader having to re-derive the background fact.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mernst/commons-io consistent-check-and-use
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/commons-io/pull/43.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #43
commit 46a2c6bebe30989d51d59e14def38a82e8edfd78
Author: Michael Ernst
Date: 2017-09-15T18:19:18Z
Make code style of hasBOM() consistent with getBOMCharsetName()
---
-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org