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

Mukul Gandhi resolved XALANJ-2594.
----------------------------------
    Resolution: Not A Problem
      Assignee: Mukul Gandhi  (was: Steven J. Hathaway)

I don't think that, the reported issue needs to be fixed. The bug reporter's 
cited Xalan-J code is following,

if (null == result) {
   String fmsg = 
XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_EMPTY_XPATH_RESULT, 
null); 
   throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,fmsg); // 
Empty XPath result object
 }

I believe that, above cited lines of code are written keeping in mind the best 
practices for how to handle exceptions within a java application. As per above 
cited code, when a null object is encountered, an XPathException is thrown 
wrapping the null condition. This is perfectly fine I believe (a raw 
NullPointerException / RuntimeException situation is presented to the user as a 
domain error information). 

> Incorrect exception being thrown
> --------------------------------
>
>                 Key: XALANJ-2594
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2594
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in 
> Xalan projects.  Anybody can view the issue.) 
>          Components: Xalan
>    Affects Versions: 2.7.2
>            Reporter: Devin Chollak
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Using an automated research tool I detected in 
> src\org\apache\xpath\domapi\XPathResultImpl.java on lines 111 to 113 you 
> throw an XPathException; however, the expectation is for it to be either a 
> NullPointerException or RuntimeException instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org
For additional commands, e-mail: dev-h...@xalan.apache.org

Reply via email to