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 202957

Summary: Code folding for Runnable does not expand properly
Product: contrib Reporter: dbell
Component: CodeAssignee: issues@contrib <issues>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.1   
Hardware: Macintosh   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

Description dbell 2011-10-03 06:08:21 UTC
[ BUILD # : 201109260601 ]
[ JDK VERSION : 1.6.26 ]

An anonymous inner class extending Runnable that takes up three lines in the
editor, does not expand properly if the inner line is followed by a comment.

Example:
<code>
SwingUtilities.invokeLater(new Runnable () {
    public void run() {
        layer.setColorings(newColoring, -1); //version
    }
});
</code>

is contracted to
<code>
[+] SwingUtilities.invokeLater([{ =>]layer.setColorings(newColoring, -1);[}]);
</code>

Pressing the [+] to expand the node yeilds
<code>
[+] SwingUtilities.invokeLater([{ =>]layer.setColorings(newColoring, -1);
//version
    }
});
</code>
with no [-] to fold the end node again. However, pressing the [+] to expand the
top node actually shrinks the bottom node again, yeilding the original
contraction.

When the comment is removed, the cold folding behaves more as expected, where
clicking on the [+] when the bottom node is expanded, expands the top node.
Comment 1 Dusan Balek 2011-10-03 10:49:03 UTC
It seems you have the Extended Java Editor module installed.
Comment 2 dbell 2011-10-03 10:55:08 UTC
(In reply to comment #1)
> It seems you have the Extended Java Editor module installed.

Indeed. It's not going to be part of the release?
Comment 3 Dusan Balek 2011-10-03 11:00:16 UTC
*** Bug 202971 has been marked as a duplicate of this bug. ***