Dave
unread,Jul 30, 2008, 1:01:03 PM7/30/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to FindBugs
Hello
I'm new to this tool, so I may misunderstand what it's telling me.
FindBugs first flagged the condition on line 2, which I fixed with
if (allDataIds != null && allDataIds.size() != 0) {
But now FindBugs insists the NP dereference error is on line 3. I've
tried declaring the local variable and it still remembers
'allDataIds'. See Ex 2. Appreciate any help! -Dave
Ex1.
1 pubic void foo(List allDataIds) {
2 if (allDataIds != null || allDataIds.size()== 0) {
3 a = process1(this, allDataIds);
4 process2(a);
5 }
6 }
Ex2.
1 pubic void foo(List allDataIds) {
2 List x = new ArrayList();
2 if (x != null && x.size() != 0) {
3 a = process1(this, x);
4 process2(a);
5 }
6 }