Github user kinow commented on a diff in the pull request:
https://github.com/apache/commons-imaging/pull/35#discussion_r210524716
--- Diff: src/main/java/org/apache/commons/imaging/icc/IccTag.java ---
@@ -73,11 +76,12 @@ private IccTagDataType getIccTagDataType(final int
quad) {
}
public void dump(final String prefix) throws ImageReadException,
IOException {
- final PrintWriter pw = new PrintWriter(new
OutputStreamWriter(System.out, Charset.defaultCharset()));
-
- dump(pw, prefix);
-
- pw.flush();
+ try (StringWriter sw = new StringWriter(); PrintWriter pw = new
PrintWriter(sw)) {
--- End diff --
This was intentional.
The previous code contains the `throws IOException` (while the other
methods don't) ->
https://github.com/apache/commons-imaging/blob/d2ec76bd10f30c39ae5180ede1254908e76045f0/src/main/java/org/apache/commons/imaging/icc/IccTag.java#L75
Should we make them all the same, catching and logging, instead of throwing
the IOException? As this is a `dump` method, not used by another method such as
`toString()`, I think the impact on end users should be minimal.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]