You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2011/04/16 22:05:05 UTC

[jira] [Created] (NEETHI-9) Errors in XML object model conversions are not handled properly

Errors in XML object model conversions are not handled properly
---------------------------------------------------------------

                 Key: NEETHI-9
                 URL: https://issues.apache.org/jira/browse/NEETHI-9
             Project: Neethi
          Issue Type: Bug
    Affects Versions: 3.0
            Reporter: Andreas Veithen
            Priority: Minor


Implementations of Converter#convert return null when an error occurs during conversion. On the other hand, AssertionBuilderFactoryImpl#invokeBuilder doesn't check for a null return value. This means that when an error occurs, a null value is passed to AssertionBuilder#build, which leads to unexpected results.

Also, the fact that the implementations of Converter#convert swallow most exceptions makes it hard to debug issues caused by problems during object model conversion.

We have two options:

1. Let Converter#convert throw an exception if there is a problem.

2. Add a null check in AssertionBuilderFactoryImpl#invokeBuilder (to solve the first problem) and make sure that exceptions thrown in Converter#convert are logged (to solve the second problem). In this case, we need to agree on the logging API to be used (commons logging or SLF4J).

Personally, I prefer option 1.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


[jira] [Resolved] (NEETHI-9) Errors in XML object model conversions are not handled properly

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

Andreas Veithen resolved NEETHI-9.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0.1

> Errors in XML object model conversions are not handled properly
> ---------------------------------------------------------------
>
>                 Key: NEETHI-9
>                 URL: https://issues.apache.org/jira/browse/NEETHI-9
>             Project: Neethi
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Andreas Veithen
>            Priority: Minor
>             Fix For: 3.0.1
>
>
> Implementations of Converter#convert return null when an error occurs during conversion. On the other hand, AssertionBuilderFactoryImpl#invokeBuilder doesn't check for a null return value. This means that when an error occurs, a null value is passed to AssertionBuilder#build, which leads to unexpected results.
> Also, the fact that the implementations of Converter#convert swallow most exceptions makes it hard to debug issues caused by problems during object model conversion.
> We have two options:
> 1. Let Converter#convert throw an exception if there is a problem.
> 2. Add a null check in AssertionBuilderFactoryImpl#invokeBuilder (to solve the first problem) and make sure that exceptions thrown in Converter#convert are logged (to solve the second problem). In this case, we need to agree on the logging API to be used (commons logging or SLF4J).
> Personally, I prefer option 1.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


[jira] [Commented] (NEETHI-9) Errors in XML object model conversions are not handled properly

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NEETHI-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13062157#comment-13062157 ] 

Hudson commented on NEETHI-9:
-----------------------------

Integrated in neethi-trunk #124 (See [https://builds.apache.org/job/neethi-trunk/124/])
    NEETHI-9: Make sure that Converter implementations throw an exception instead of returning null.

veithen : 
Files : 
* /webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/converters/StaxToDOMConverter.java
* /webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/converters/ConverterException.java
* /webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/converters/DOMToStaxConverter.java
* /webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/converters/Converter.java


> Errors in XML object model conversions are not handled properly
> ---------------------------------------------------------------
>
>                 Key: NEETHI-9
>                 URL: https://issues.apache.org/jira/browse/NEETHI-9
>             Project: Neethi
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Andreas Veithen
>            Priority: Minor
>
> Implementations of Converter#convert return null when an error occurs during conversion. On the other hand, AssertionBuilderFactoryImpl#invokeBuilder doesn't check for a null return value. This means that when an error occurs, a null value is passed to AssertionBuilder#build, which leads to unexpected results.
> Also, the fact that the implementations of Converter#convert swallow most exceptions makes it hard to debug issues caused by problems during object model conversion.
> We have two options:
> 1. Let Converter#convert throw an exception if there is a problem.
> 2. Add a null check in AssertionBuilderFactoryImpl#invokeBuilder (to solve the first problem) and make sure that exceptions thrown in Converter#convert are logged (to solve the second problem). In this case, we need to agree on the logging API to be used (commons logging or SLF4J).
> Personally, I prefer option 1.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


[jira] [Commented] (NEETHI-9) Errors in XML object model conversions are not handled properly

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NEETHI-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055733#comment-13055733 ] 

Daniel Kulp commented on NEETHI-9:
----------------------------------


I'd prefer #1 as well.  The only issue would be that if it's a checked exception, it's a slight API change that would likely need to warrant it being 3.1 instead of 3.0.1.

> Errors in XML object model conversions are not handled properly
> ---------------------------------------------------------------
>
>                 Key: NEETHI-9
>                 URL: https://issues.apache.org/jira/browse/NEETHI-9
>             Project: Neethi
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Andreas Veithen
>            Priority: Minor
>
> Implementations of Converter#convert return null when an error occurs during conversion. On the other hand, AssertionBuilderFactoryImpl#invokeBuilder doesn't check for a null return value. This means that when an error occurs, a null value is passed to AssertionBuilder#build, which leads to unexpected results.
> Also, the fact that the implementations of Converter#convert swallow most exceptions makes it hard to debug issues caused by problems during object model conversion.
> We have two options:
> 1. Let Converter#convert throw an exception if there is a problem.
> 2. Add a null check in AssertionBuilderFactoryImpl#invokeBuilder (to solve the first problem) and make sure that exceptions thrown in Converter#convert are logged (to solve the second problem). In this case, we need to agree on the logging API to be used (commons logging or SLF4J).
> Personally, I prefer option 1.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


[jira] [Commented] (NEETHI-9) Errors in XML object model conversions are not handled properly

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NEETHI-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13060842#comment-13060842 ] 

Andreas Veithen commented on NEETHI-9:
--------------------------------------

I think that this case meets the two criteria for using an unchecked exception:
* The exception occurs only if something goes badly wrong (like a missing or incompatible dependency lib).
* There is nothing that the calling code could to about the error, except for reporting it to the user.

> Errors in XML object model conversions are not handled properly
> ---------------------------------------------------------------
>
>                 Key: NEETHI-9
>                 URL: https://issues.apache.org/jira/browse/NEETHI-9
>             Project: Neethi
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Andreas Veithen
>            Priority: Minor
>
> Implementations of Converter#convert return null when an error occurs during conversion. On the other hand, AssertionBuilderFactoryImpl#invokeBuilder doesn't check for a null return value. This means that when an error occurs, a null value is passed to AssertionBuilder#build, which leads to unexpected results.
> Also, the fact that the implementations of Converter#convert swallow most exceptions makes it hard to debug issues caused by problems during object model conversion.
> We have two options:
> 1. Let Converter#convert throw an exception if there is a problem.
> 2. Add a null check in AssertionBuilderFactoryImpl#invokeBuilder (to solve the first problem) and make sure that exceptions thrown in Converter#convert are logged (to solve the second problem). In this case, we need to agree on the logging API to be used (commons logging or SLF4J).
> Personally, I prefer option 1.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org