You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Dirk Moebius (JIRA)" <ji...@apache.org> on 2010/04/28 11:42:31 UTC

[jira] Created: (PIVOT-483) better exception reporting for BeanAdapter

better exception reporting for BeanAdapter
------------------------------------------

                 Key: PIVOT-483
                 URL: https://issues.apache.org/jira/browse/PIVOT-483
             Project: Pivot
          Issue Type: Improvement
          Components: core-beans
    Affects Versions: 1.5.1
            Reporter: Dirk Moebius
            Priority: Minor
             Fix For: 1.5.1


If BeanAdapter fails to get or set the value of a property for any reason (eg. wrong type, illegal argument exception etc.), the name of the property is not reported.

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


[jira] Commented: (PIVOT-483) better exception reporting for BeanAdapter

Posted by "Dirk Moebius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862192#action_12862192 ] 

Dirk Moebius commented on PIVOT-483:
------------------------------------

Thanks for fixing this. I wasn't aware that getTargetException() has been (sort of) "deprecated", thanks for pointing that out.

I don't care much about not having PropertyException. I was thinking about a future gui editor or some other tooling, where it might come handy to exactly know which property failed and why. If you take it to the extreme, you could create "PropertyGetException" and "PropertySetException", both carrying the property name in question, so the gui editor could highlight the failed property etc. But, as you said, not a strong use case.

> better exception reporting for BeanAdapter
> ------------------------------------------
>
>                 Key: PIVOT-483
>                 URL: https://issues.apache.org/jira/browse/PIVOT-483
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>            Reporter: Dirk Moebius
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: pivot-483-better_exception_reporting.patch
>
>
> If BeanAdapter fails to get or set the value of a property for any reason (eg. wrong type, illegal argument exception etc.), the name of the property is not reported.

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


[jira] Resolved: (PIVOT-483) better exception reporting for BeanAdapter

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

Greg Brown resolved PIVOT-483.
------------------------------

    Resolution: Fixed

This is resolved. I didn't create the additional PropertyException class, but I did apply the other changes. The only reason I could see for adding the exception class would be so callers could explicitly catch it, and it doesn't seem like there is a strong use case for that. But let me know if you think otherwise.

I also changed getTargetException() to getCause() - see the Javadoc for this method:

http://java.sun.com/javase/6/docs/api/java/lang/reflect/InvocationTargetException.html#getTargetException()



> better exception reporting for BeanAdapter
> ------------------------------------------
>
>                 Key: PIVOT-483
>                 URL: https://issues.apache.org/jira/browse/PIVOT-483
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 1.5.1
>            Reporter: Dirk Moebius
>            Priority: Minor
>             Fix For: 1.5.1
>
>         Attachments: pivot-483-better_exception_reporting.patch
>
>
> If BeanAdapter fails to get or set the value of a property for any reason (eg. wrong type, illegal argument exception etc.), the name of the property is not reported.

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


[jira] Updated: (PIVOT-483) better exception reporting for BeanAdapter

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

Chris Bartlett updated PIVOT-483:
---------------------------------

    Attachment: BeanAdapter.ExceptionInfo.patch.zip

When I looking at https://issues.apache.org/jira/browse/PIVOT-501, I noticed that the BeanAdapter exceptions don't include any class information for the bean.

The attached patch appends this basic info to the Exception's message.
(Format the message as desired if this patch is deemed useful)

> better exception reporting for BeanAdapter
> ------------------------------------------
>
>                 Key: PIVOT-483
>                 URL: https://issues.apache.org/jira/browse/PIVOT-483
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>            Reporter: Dirk Moebius
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: BeanAdapter.ExceptionInfo.patch.zip, pivot-483-better_exception_reporting.patch
>
>
> If BeanAdapter fails to get or set the value of a property for any reason (eg. wrong type, illegal argument exception etc.), the name of the property is not reported.

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


[jira] Updated: (PIVOT-483) better exception reporting for BeanAdapter

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

Greg Brown updated PIVOT-483:
-----------------------------

        Fix Version/s: 1.5
                           (was: 1.5.1)
    Affects Version/s:     (was: 1.5.1)

> better exception reporting for BeanAdapter
> ------------------------------------------
>
>                 Key: PIVOT-483
>                 URL: https://issues.apache.org/jira/browse/PIVOT-483
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>            Reporter: Dirk Moebius
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: pivot-483-better_exception_reporting.patch
>
>
> If BeanAdapter fails to get or set the value of a property for any reason (eg. wrong type, illegal argument exception etc.), the name of the property is not reported.

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


[jira] Commented: (PIVOT-483) better exception reporting for BeanAdapter

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869970#action_12869970 ] 

Greg Brown commented on PIVOT-483:
----------------------------------

Thanks for the suggestion. See:

http://svn.apache.org/viewvc/pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java?view=diff&r1=946986&r2=946987&pathrev=946987



> better exception reporting for BeanAdapter
> ------------------------------------------
>
>                 Key: PIVOT-483
>                 URL: https://issues.apache.org/jira/browse/PIVOT-483
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>            Reporter: Dirk Moebius
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: BeanAdapter.ExceptionInfo.patch.zip, pivot-483-better_exception_reporting.patch
>
>
> If BeanAdapter fails to get or set the value of a property for any reason (eg. wrong type, illegal argument exception etc.), the name of the property is not reported.

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


[jira] Updated: (PIVOT-483) better exception reporting for BeanAdapter

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

Dirk Moebius updated PIVOT-483:
-------------------------------

    Attachment: pivot-483-better_exception_reporting.patch

My attached patch fixes this issue. I created a new RuntimeException subclass called "PropertyException" which is thrown if BeanAdapter fails to set or get a property value. I made PropertyNotFoundException a subclass of the more general PropertyException, to callers can catch both.

> better exception reporting for BeanAdapter
> ------------------------------------------
>
>                 Key: PIVOT-483
>                 URL: https://issues.apache.org/jira/browse/PIVOT-483
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 1.5.1
>            Reporter: Dirk Moebius
>            Priority: Minor
>             Fix For: 1.5.1
>
>         Attachments: pivot-483-better_exception_reporting.patch
>
>
> If BeanAdapter fails to get or set the value of a property for any reason (eg. wrong type, illegal argument exception etc.), the name of the property is not reported.

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