You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "sean.mullan (JIRA)" <ji...@apache.org> on 2010/12/30 20:50:46 UTC

[jira] Assigned: (SANTUARIO-214) JSR 105 exceptions should not have it's own 'cause' field

     [ https://issues.apache.org/jira/browse/SANTUARIO-214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

sean.mullan reassigned SANTUARIO-214:
-------------------------------------

    Assignee: sean.mullan  (was: XML Security Developers Mailing List)

> JSR 105 exceptions should not have it's own 'cause' field
> ---------------------------------------------------------
>
>                 Key: SANTUARIO-214
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-214
>             Project: Santuario
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: Java 1.4.2
>         Environment: Operating System: All
> Platform: All
>            Reporter: Zoran Regvart
>            Assignee: sean.mullan
>
> All of the Exceptions in javax.xml.crypto.** packages are designed so that they have a Throwable cause field, this is an anti-pattern and should be avoided. Proper way of containing root cause for the exception is to call Exception(Throwable cause) or Exception(String message, Throwable cause) super constructor.
> To be fair this is somewhat indicated in the javadocs by the:
> "Note that the detail message associated with
>      * <code>cause</code> is <i>not</i> automatically incorporated in
>      * this exception's detail message."
> but I fail to see the reason for this design decision. The only reason I could hypothesize is that the root cause could contain sensitive information, but in that case implementation that threw the exception should not include any sensitive information, or should appropriately obfuscate the same.
> Implementing the exceptions by using appropriate super constructors would reduce the complexity of the current implementation, and would be inline with best practices for creating one's own exceptions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.