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

ASF GitHub Bot commented on IMAGING-154:
----------------------------------------

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.


> Remove Debug class
> ------------------
>
>                 Key: IMAGING-154
>                 URL: https://issues.apache.org/jira/browse/IMAGING-154
>             Project: Commons Imaging
>          Issue Type: Task
>    Affects Versions: Patch Needed
>            Reporter: Benedikt Ritter
>            Assignee: Bruno P. Kinoshita
>            Priority: Major
>             Fix For: 1.0
>
>
> Low level libraries should not do logging, but communicate through the use of 
> exceptions and meaningful return values. Remove the Debug class and  all it's 
> uses.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to