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 214312

Summary: StackOverflowError at javax.swing.LayoutComparator.compare
Product: guibuilder Reporter: jorgenc
Component: CodeAssignee: issues@guibuilder <issues>
Status: RESOLVED WONTFIX    
Severity: normal CC: germor, teJECSke, zolta
Priority: P3    
Version: 7.0   
Hardware: All   
OS: All   
See Also: https://netbeans.org/bugzilla/show_bug.cgi?id=241958
Issue Type: DEFECT Exception Reporter: 189598
Attachments: stacktrace

Description jorgenc 2012-06-16 16:05:19 UTC
This bug was originally marked as duplicate of bug 163256, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.0.1 (Build 201108281501)
VM: Java HotSpot(TM) Client VM, 14.3-b01, Java(TM) SE Runtime Environment, 1.6.0_17-b04
OS: Windows 7

User Comments:
jorgenc: se quedad




Stacktrace: 
java.lang.StackOverflowError
   at javax.swing.LayoutComparator.compare(LayoutComparator.java:50)
   at javax.swing.DefaultFocusManager.compareTabOrder(DefaultFocusManager.java:130)
   at javax.swing.CompareTabOrderComparator.compare(CompareTabOrderComparator.java:153)
   at java.util.Arrays.mergeSort(Arrays.java:1270)
   at java.util.Arrays.mergeSort(Arrays.java:1281)
   at java.util.Arrays.mergeSort(Arrays.java:1281)
Comment 1 jorgenc 2012-06-16 16:05:26 UTC
Created attachment 120940 [details]
stacktrace
Comment 2 Tomas Pavek 2012-06-19 12:02:42 UTC
Possible steps to reproduce:
* Create a new JPanel form, add a JButton to it.
* Set the button's focusTraversalPolicyProvider to true.
* Set the button's focusable property to false.
* Invoke form preview, if you don't get the exception right away, press Tab.

I was not able to get the exception from the designer (IDE itself), only from the preview dialog. Also, when the GUI form is run, the same exception happens. So when we build the Swing UI for preview, we also get it.

It's basically a Swing bug: either should not allow to set invalid combination of property values, or should not fail on it (end up in an infinite cycle). We could possibly warn the user somehow in this special case, but it would be really hacky, and the combination of the properties does not make sense anyway, so almost nobody really tries it (that's why we had only a few exception reports).

IMHO not worth trying to workaround.
Comment 3 Tomas Pavek 2012-07-18 16:45:28 UTC
*** Bug 163256 has been marked as a duplicate of this bug. ***
Comment 4 Tomas Pavek 2012-07-18 16:45:42 UTC
*** Bug 190960 has been marked as a duplicate of this bug. ***
Comment 5 Tomas Pavek 2012-07-18 16:45:56 UTC
*** Bug 215591 has been marked as a duplicate of this bug. ***