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
Environment: ALL
Reporter: Michele Vivoda
Priority: Minor
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.