You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2009/03/15 02:56:50 UTC

[jira] Created: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

ExceptionUtils + ExceptionUtilsTest needs an overhaul
-----------------------------------------------------

                 Key: LANG-491
                 URL: https://issues.apache.org/jira/browse/LANG-491
             Project: Commons Lang
          Issue Type: Sub-task
            Reporter: Henri Yandell
             Fix For: 3.0


With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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


[jira] Commented: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795824#action_12795824 ] 

Henri Yandell commented on LANG-491:
------------------------------------

Considered adding an initCause wrapper to replace setCause; it would basically just be a null safe and exception protecting call to the underlying Throwable method. 

Both of the exceptions seem very relevant and shouldn't be hidden; and the primary use for initCause would be in a child of an Exception that doesn't provide a Throwable set of constructors; so null protection is unneeded.

> ExceptionUtils + ExceptionUtilsTest needs an overhaul
> -----------------------------------------------------
>
>                 Key: LANG-491
>                 URL: https://issues.apache.org/jira/browse/LANG-491
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.exception.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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


[jira] Commented: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795805#action_12795805 ] 

Henri Yandell commented on LANG-491:
------------------------------------

Starting to look at the code.

public boolean isThrowableNested() should be deleted. It is always true above JDK 1.4. This also means that isNestedThrowable should also be deleted, it's also always true above JDK 1.4.

getFullStackTrace then makes little sense. In 1.4+ it only ever prints one item.

All three removed in r895097.

> ExceptionUtils + ExceptionUtilsTest needs an overhaul
> -----------------------------------------------------
>
>                 Key: LANG-491
>                 URL: https://issues.apache.org/jira/browse/LANG-491
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.exception.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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


[jira] Commented: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795826#action_12795826 ] 

Henri Yandell commented on LANG-491:
------------------------------------

Removed removeCauseMethodName and addCauseMethodName - this isn't a good style of design as it inflicted the need to synchronize on the code. Also removed isCauseMethodName - technically it could stay, but with add/remove gone I didn't feel that this was a very worthwhile use case.

Added getDefaultCauseMethodNames, returning a clone of the CAUSE_METHOD_NAMES array. 

(r895129)

> ExceptionUtils + ExceptionUtilsTest needs an overhaul
> -----------------------------------------------------
>
>                 Key: LANG-491
>                 URL: https://issues.apache.org/jira/browse/LANG-491
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.exception.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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


[jira] Commented: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795828#action_12795828 ] 

Henri Yandell commented on LANG-491:
------------------------------------

For some reason getCause was also hardcoded to look for a field called 'detail'. I suspect this is one particular use case, and odds are it's either a) not very important any more or b) has migrated to the getCause() API. Removing it removes an odd feature and gets rid of a lump of code. (r895131).

> ExceptionUtils + ExceptionUtilsTest needs an overhaul
> -----------------------------------------------------
>
>                 Key: LANG-491
>                 URL: https://issues.apache.org/jira/browse/LANG-491
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.exception.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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


[jira] Commented: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795830#action_12795830 ] 

Henri Yandell commented on LANG-491:
------------------------------------

Deleted 30% of the lines :) The remaining code is looking more justifiable, though we should ditch the getCause method in Lang 4.0. SQLException is fixed in Java 6 and it will be fair to expect people to be off of Lang 2.x by then. To that end I've deprecated the relevant methods (r895132). 

> ExceptionUtils + ExceptionUtilsTest needs an overhaul
> -----------------------------------------------------
>
>                 Key: LANG-491
>                 URL: https://issues.apache.org/jira/browse/LANG-491
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.exception.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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


[jira] Commented: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795822#action_12795822 ] 

Henri Yandell commented on LANG-491:
------------------------------------

Removed the selfClause testing in ExceptionUtilsTest as its no longer a legal value.

> ExceptionUtils + ExceptionUtilsTest needs an overhaul
> -----------------------------------------------------
>
>                 Key: LANG-491
>                 URL: https://issues.apache.org/jira/browse/LANG-491
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.exception.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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


[jira] Commented: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795821#action_12795821 ] 

Henri Yandell commented on LANG-491:
------------------------------------

Removed private getCauseUsingWellKnownTypes and dropping the optimization step for SQLException and InvocationTargetException; plus a simplification of the code in getCause(String,String[]).

This does mean a slight change in behaviour - instanceof SQLException (and InvocationTargetException) were always checked regardless of what you passed in as method names. I view that as a bug, so happy to see it go away.

> ExceptionUtils + ExceptionUtilsTest needs an overhaul
> -----------------------------------------------------
>
>                 Key: LANG-491
>                 URL: https://issues.apache.org/jira/browse/LANG-491
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.exception.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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


[jira] Commented: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795818#action_12795818 ] 

Henri Yandell commented on LANG-491:
------------------------------------

Test on OS X Java 6; setNextException doesn't lead to getCause returning anything on either SQLException (self or the next exception).

> ExceptionUtils + ExceptionUtilsTest needs an overhaul
> -----------------------------------------------------
>
>                 Key: LANG-491
>                 URL: https://issues.apache.org/jira/browse/LANG-491
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.exception.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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


[jira] Commented: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795804#action_12795804 ] 

Henri Yandell commented on LANG-491:
------------------------------------

Note, SQLException in Java6 supports a getCause. Unsure if this is the same as the chained exception or additional.

> ExceptionUtils + ExceptionUtilsTest needs an overhaul
> -----------------------------------------------------
>
>                 Key: LANG-491
>                 URL: https://issues.apache.org/jira/browse/LANG-491
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.exception.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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


[jira] Closed: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-491.
------------------------------

    Resolution: Fixed

This resolves my issues with ExceptionUtils. ExceptionUtilsTest is still a bit messy, but the code coverage is up (having removed code that had less) and removing getCause in 4.0 will clean things up further.

> ExceptionUtils + ExceptionUtilsTest needs an overhaul
> -----------------------------------------------------
>
>                 Key: LANG-491
>                 URL: https://issues.apache.org/jira/browse/LANG-491
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.exception.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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


[jira] Commented: (LANG-491) ExceptionUtils + ExceptionUtilsTest needs an overhaul

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795825#action_12795825 ] 

Henri Yandell commented on LANG-491:
------------------------------------

Removed setCause method. JDK 1.4 provided an initCause method and this method was to support both pre and post JDK 1.4 use cases. I don't see much of a reason to keep supporting Exceptions that have setCause as well as the inherited initCause.

> ExceptionUtils + ExceptionUtilsTest needs an overhaul
> -----------------------------------------------------
>
>                 Key: LANG-491
>                 URL: https://issues.apache.org/jira/browse/LANG-491
>             Project: Commons Lang
>          Issue Type: Sub-task
>          Components: lang.exception.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> With the nested stuff removed, ExceptionUtils and its test class are carrying some baggage.

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