commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Benson (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (JXPATH-107) RCN: Nullcheck of NodePointer.parent of value previously dereferenced in PropertyOwnerPointer.setValue(Object)
Date Tue, 11 Dec 2007 19:34:43 GMT

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

Matt Benson resolved JXPATH-107.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3

Moved the parent != null check outward.  Thanks!

> RCN: Nullcheck of NodePointer.parent of value previously dereferenced in PropertyOwnerPointer.setValue(Object)
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: JXPATH-107
>                 URL: https://issues.apache.org/jira/browse/JXPATH-107
>             Project: Commons JXPath
>          Issue Type: Bug
>    Affects Versions: Nightly Builds
>         Environment: ALL
>            Reporter: Michele Vivoda
>            Priority: Minor
>             Fix For: 1.3
>
>
> In class PropertyOwnerPointer, method setValue
> The code says first 
> if (parent.isContainer()) ...
> then it checks for parent not being null.
> else if (parent != null) {
> If the parent could be null the first code
> would trigger a null pointer exception.
> So I think:
> now the parent happens to be never null
> but either 
> 1. the (parent!=null) check is unecessary 
> (I don't know the exact semantics of this class)
> 2. or more probably the {parent.isContainer()} block should be put inside
> the {parent!=null} check.
> An other findbugs find.

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


Mime
View raw message