commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NET-153) Add getCause method to CopyStreamException
Date Tue, 30 Aug 2011 15:31:40 GMT

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

Sebb commented on NET-153:
--------------------------

Yes, the update does seem to have been lost.

However, now that we require Java 1.5, and getCause()/initCause() were added to Throwable
in 1.4, would it not be better to use the underlying cause field from Throwable?

i.e. rather than overriding getCause, we should store the cause using initCause(), and update
the method as follows:

{code}

public IOException getIOException()
{
    return getCause();
}
{code}

This could further be simplified to merge the initCause() in the super(message) method invocation
once Java 1.6 is a minimum requirement.


> Add getCause method to CopyStreamException
> ------------------------------------------
>
>                 Key: NET-153
>                 URL: https://issues.apache.org/jira/browse/NET-153
>             Project: Commons Net
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Dan Godfrey
>            Priority: Trivial
>             Fix For: 2.0
>
>         Attachments: CopyStreamException.patch
>
>
> Add a getCause method to CopyStreamException that has the same signature as Throwable#getCause
from JDK 1.4 and returns the wrapped IOException.
> This will override the existing getCause method in version of Java > 1.4 and hence
include the IOExceptions stack trace in the CopyStreamExceptions stack trace or just be ignored
in Java 1.3.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message