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 253745 - Assertion error when moving multiple components
Summary: Assertion error when moving multiple components
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Natural Layout (show other bugs)
Version: 8.1
Hardware: PC Windows 8 x64
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 253743 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-07-24 14:04 UTC by mienamoo
Modified: 2015-09-09 16:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Java class of file to reproduce issue (9.95 KB, application/octet-stream)
2015-07-24 18:36 UTC, mienamoo
Details
Form file to reproduce issue (9.93 KB, application/octet-stream)
2015-07-24 18:38 UTC, mienamoo
Details
Step 1 form (10.04 KB, application/octet-stream)
2015-07-31 15:31 UTC, mienamoo
Details
Step 1 java (9.73 KB, application/octet-stream)
2015-07-31 15:32 UTC, mienamoo
Details
Step 2 form (10.31 KB, application/octet-stream)
2015-07-31 15:33 UTC, mienamoo
Details
Step 2 java (9.75 KB, application/octet-stream)
2015-07-31 15:33 UTC, mienamoo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mienamoo 2015-07-24 14:04:58 UTC
I was executing the steps of this test:
http://services.netbeans.org/synergy/client/app/index.html#/case/1306/suite/1073/v/1

In step 5, when dragging the components outside of the panel, the exception below occurred. The components returned to their previous position after I closed the exception reporter.


Reported at http://statistics.netbeans.org/analytics/exception.do?id=786750

java.lang.AssertionError
        at org.netbeans.modules.form.layoutdesign.LayoutInterval.getCurrentSpace(LayoutInterval.java:503)
        at org.netbeans.modules.form.layoutdesign.LayoutInterval.getCurrentPositions(LayoutInterval.java:1024)
        at org.netbeans.modules.form.layoutdesign.LayoutDesigner.restrictedCopy(LayoutDesigner.java:1142)
        at org.netbeans.modules.form.layoutdesign.LayoutDesigner.restrictedCopy(LayoutDesigner.java:1045)
        at org.netbeans.modules.form.layoutdesign.LayoutDesigner.restrictedCopy(LayoutDesigner.java:1045)
        at org.netbeans.modules.form.layoutdesign.LayoutDesigner.endMoving(LayoutDesigner.java:799)
        at org.netbeans.modules.form.HandleLayer$ExistingComponentDrag.end(HandleLayer.java:3052)
        at org.netbeans.modules.form.HandleLayer$ComponentDrag.end(HandleLayer.java:2765)
        at org.netbeans.modules.form.HandleLayer.endDragging(HandleLayer.java:1379)
        at org.netbeans.modules.form.HandleLayer.mouseReleased(HandleLayer.java:1933)
        at java.awt.Component.processMouseEvent(Component.java:6525)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
        at java.awt.Component.processEvent(Component.java:6290)
        at java.awt.Container.processEvent(Container.java:2234)
        at java.awt.Component.dispatchEventImpl(Component.java:4881)
        at java.awt.Container.dispatchEventImpl(Container.java:2292)
        at java.awt.Component.dispatchEvent(Component.java:4703)
        at java.awt.LightweightDispatcher.retargetMouseEvent(LightweightDispatcher.java:4898)
        at java.awt.LightweightDispatcher.processMouseEvent(LightweightDispatcher.java:4533)
        at java.awt.LightweightDispatcher.dispatchEvent(LightweightDispatcher.java:4462)
....
Comment 1 mienamoo 2015-07-24 14:06:56 UTC
The same exception happens if I move a single JButton from the JPanel to the outer JFrame too.
Comment 2 mienamoo 2015-07-24 14:10:04 UTC
Ah, I see I was a little hasty in creating this issue manually to get a bug number... the automatically reported bug related to this one is Bug 253743. :)
Comment 3 Tomas Pavek 2015-07-24 14:36:27 UTC
Any chance you have a GUI form at a state from which the exception can be reproduced?
Comment 4 mienamoo 2015-07-24 18:36:23 UTC
Created attachment 154864 [details]
Java class of file to reproduce issue
Comment 5 mienamoo 2015-07-24 18:38:18 UTC
Created attachment 154865 [details]
Form file to reproduce issue

Please see attached the frame I was busy testing on. When I started up the IDE again, I had to drag and drop various things before the assertion happened, so difficult to tell you exactly what to do. But at this moment, if I move jButton4 onto jPanel1, I get the error.
Comment 6 Tomas Pavek 2015-07-27 16:36:39 UTC
Thanks for trying to give us a test sample. Looks like in the case of the attached form the problematic operation causing the error happened just before moving jButton4. That put the layout structure around jButton4 into a bad state that led to the exception when trying to move jButton4. I guess you don't remember anymore what the last move before that was? According to the wrong space element that was left (in vertical dimension) it was likely a JLabel component (vertically somewhere between jButton4 and jRadioButton1). I've tried to simulate that myself, but no luck so far.

That superfluous space element can be seen in the form file, but it gets joined with the adjacent spaces when the GUI form is opened, so the exception cannot be reproduced simply by opening the form and moving the jButton4. The mystery is how this space joining mechanism was not applied after the last move that preceded the failing jButton4 move...

In either case, if you were still willing to play with this and able to reproduce, if you get this exception again, we'd need you to do undo one step and tell us what the lats but one operation was (in fact you can save the form after the exception happened, copy the files elsewhere, then undo and again save the files, so having the form in the state before and after). Thanks.
Comment 7 mienamoo 2015-07-28 08:21:31 UTC
I will have some time to test on Friday. Will give you feedback then. :)
Comment 8 mienamoo 2015-07-31 15:29:22 UTC
OK, I think I have a better test case for you. :) Attachments to follow.

Start with the Step 1 class and form. Select jLabel1, jButton4 and jTextField1, and drag them all together off the panel directly onto the JFrame. This results in the files that I will call Step 2 when I upload them. Then move them again, without closing the form file, say a little bit to the right (still on the JFrame). The error occurs.
Comment 9 mienamoo 2015-07-31 15:31:57 UTC
Created attachment 155094 [details]
Step 1 form
Comment 10 mienamoo 2015-07-31 15:32:21 UTC
Created attachment 155095 [details]
Step 1 java
Comment 11 mienamoo 2015-07-31 15:33:08 UTC
Created attachment 155096 [details]
Step 2 form
Comment 12 mienamoo 2015-07-31 15:33:42 UTC
Created attachment 155097 [details]
Step 2 java
Comment 13 Tomas Pavek 2015-08-19 17:21:45 UTC
Great, I can reproduce the bug now. Thanks a lot for finding the test case!
Comment 14 mienamoo 2015-08-20 10:34:16 UTC
(In reply to Tomas Pavek from comment #13)
> Great, I can reproduce the bug now. Thanks a lot for finding the test case!

Glad I could help! :D
Comment 15 Tomas Pavek 2015-09-08 09:37:31 UTC
Fixed.

http://hg.netbeans.org/jet-main/rev/03a60a1e0c1c
Comment 16 Quality Engineering 2015-09-09 01:23:30 UTC
Integrated into 'main-silver', will be available in build *201509090002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/03a60a1e0c1c
User: Tomas Pavek <tpavek@netbeans.org>
Log: #253745: fixing case of dissolving a sequential group that might leave two consecutive gaps
Comment 17 Tomas Pavek 2015-09-09 16:09:22 UTC
*** Bug 253743 has been marked as a duplicate of this bug. ***