This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 174325 - program counter jumps into body of 'if statement' wrongly
Summary: program counter jumps into body of 'if statement' wrongly
Status: CLOSED DUPLICATE of bug 168365
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@debugger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-12 07:36 UTC by donnut
Modified: 2010-05-06 08:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description donnut 2009-10-12 07:36:10 UTC
In the following code snippet the function Utils.IsTextNode(tNode) returns true, but the program counter jumps to step 2. 

      for (TagNode tNode:tagList) {     
            if (!Utils.IsTextNode(tNode)) {   <-- step 1

                if (Utils.IsVNode(tNode)) {
                    numVNodes++;              <-- step 2
                }
            }
        }
Adding the line "boolean qq = Utils.IsTextNode(tNode);" between the for and first if statement 'solves' this behaviour:

      for (TagNode tNode:tagList) {     
            boolean qq = Utils.IsTextNode(tNode);
            if (!Utils.IsTextNode(tNode)) {   <-- step 1

                if (Utils.IsVNode(tNode)) {
                    numVNodes++;              
                }
            }
        }                                     <-- step 2

Leaving the line with the qq variable assignment, but uncommenting it, makes the debugger behave wrongly again: 
      for (TagNode tNode:tagList) {     
            // boolean qq = Utils.IsTextNode(tNode);
            if (!Utils.IsTextNode(tNode)) {   <-- step 1

                if (Utils.IsVNode(tNode)) {
                    numVNodes++;              <-- step 2
                }
            }
        }
Comment 1 Daniel Prusa 2009-10-12 08:53:27 UTC
This problem is caused by a defect in Java compiler and cannot be fixed in NetBeans. It has been already reported
against JDK, see issue 168365 for more details.

*** This issue has been marked as a duplicate of 168365 ***
Comment 2 Marian Mirilovic 2010-05-06 08:02:39 UTC
verified duplicate