Look at the whole method, not just the few lines in a diff.
For example, in TreeView, the ancestorCheckStates variable is accessed
like this:
Sequence<NodeCheckState> ancestorCheckStates = null;
if (showMixedCheckmarkState) {
ancestorCheckStates = new
ArrayList<NodeCheckState>(path.getLength() - 1);
......
}
.......
if (showMixedCheckmarkState) {
.....
for (int i = ancestorPath.getLength() - 1; i >= 0; i--) {
NodeCheckState ancestorPreviousCheckState =
ancestorCheckStates.get(i);
....
}
}
So in the places where it is accessed, it can never be null.
The same applies to the other 2 changes in this diff.
On 2012-05-15 15:19, Sandro Martini wrote:
Hi Noel,
Note that Eclipse's null checker is wrong in these cases, because the if
conditions mean that it can never be null in those places.
The checker is pretty smart, but it's not always right.
Are you sure ? Looking at that code it seems that (in some cases)
could happen to have related variables null, so my additional check
... but note that looking only at diff it's not so clear ...
http://svn.apache.org/viewvc?view=revision&revision=1338663
If there aren't objections I'd try to keep these changes for some day,
and in the meantime I'm testing/retisting everything many times and in
many ways :-) .
Bye