Priority
Normal
Type
Bug 
State
Fixed 
Assignee
Maxim Mossienko 
Subsystem
No subsystem 
Affected versions
Fixed in
Fixed in build
Next build 
Build
7318
Fixed in build
7599
  • Submitted by   Stephen Friedrich
    2 years ago (02 Oct 2007 03:45)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:53)
  • Jira: IDEA-41243
    (history, comments)

IDEA-41243

InspectionJS: Wrong warning about infinite recursion

0
Added by <no user>
15 Sep 2009
infinite.png   (7 KB)

I have no idea whether this is a good way to do this, but it definitely does not recurse infinitely:
function findTrParentNode(node) {
                        if("TR" == node.tagName) {
                            return node;
                        }
                        if(node == null) {
                            return null;
                        }
                        return findTrParentNode(node.parentNode);
                    }


Issue was resolved
Comments (2)
 
History (1)
 
Links
 
Sascha Weinreuter
  Sascha Weinreuter
02 Oct 2007 12:22
(2 years ago)
#permalink
I'd make this statement

if(node == null) {
 return null;
}


the first one, but apart from that, I'd say it's pretty common code :)
Stephen Friedrich
  Stephen Friedrich
02 Oct 2007 16:47
(2 years ago)
#permalink
Oops. Still even with the correct ordering of 'ifs' the warning is shown.