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 103199 - Undo after Cut&Paste removes componets from designer
Summary: Undo after Cut&Paste removes componets from designer
Status: VERIFIED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All Linux
: P1 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 103304 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-05-03 09:10 UTC by Jiri Vagner
Modified: 2007-11-23 08:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log from M9 build (21.23 KB, text/plain)
2007-05-03 09:12 UTC, Jiri Vagner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Vagner 2007-05-03 09:10:21 UTC
Steps to reproduce :
Create new JFrame
Add two JButtons
Add empty JPanel
Select 1st button and press CTRL+X
Select empty panel and press CTRL+V
Press Undo in IDE toolbar, button is gone, on NB Dev it throws NPE
(If it is possible, select second button press CTRL+X, CTRL+V and second button
is gone.)


It throws nothing on NB M9, but it starts disappearing of components.
It throws NPE on NetBeans IDE Dev (Build 20070503-0423) ...

java.lang.NullPointerException
	at
org.netbeans.modules.form.VisualReplicator.updateContainerLayout(VisualReplicator.java:298)
	at
org.netbeans.modules.form.VisualReplicator.updateAddedComponents(VisualReplicator.java:344)
	at org.netbeans.modules.form.FormDesigner$FormListener.run(FormDesigner.java:2183)
	at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:216)
Comment 1 Jiri Vagner 2007-05-03 09:12:09 UTC
Created attachment 42082 [details]
messages.log from M9 build
Comment 2 Jiri Vagner 2007-05-03 09:19:48 UTC
NetBeans IDE 6.0 Preview (M9, build 070502)
1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02
Linux version 2.6.17-10-386 running on i386

NetBeans IDE Dev (Build 20070503-0423)
1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02
Linux version 2.6.17-10-386 running on i386
Comment 3 Jiri Vagner 2007-05-03 09:37:03 UTC
Netbeans IDE Dev (build 200705021800)
1.5.0_06; Java HotSpot Client VM 1.5.0-06-64
Mac OS X version 10.4.6 running on ppc
Comment 4 Martin Balin 2007-05-03 09:38:03 UTC
Not a J1 stopper.
Comment 5 Jiri Vagner 2007-05-04 11:29:22 UTC
"Undo" is innocent, I'm able to reproduce it without using it.

Steps to reproduce:
Create new JFrame
Add JButton
Add empty JPanel

In Designer or in Inspector ...
  - select button and press CTRL+X 
  - select panel and press CTRL+V

Or only in Inspector drag button node and drop it above panel node
Comment 6 Jiri Vagner 2007-05-04 11:39:53 UTC
*** Issue 103304 has been marked as a duplicate of this issue. ***
Comment 7 Jiri Vagner 2007-05-04 11:52:48 UTC
I'm sorry for this chaos with isssue summary.
Comment 8 Jan Stola 2007-05-14 18:50:41 UTC
I am able to reproduce the issue with the latest development build using the 
last steps of jvagner. The exceptions being thrown are:

java.lang.AssertionError
  at o.n.m.f.layoutdesign.support.SwingLayoutBuilder.fillGroup
     (SwingLayoutBuilder.java:228)
  at o.n.m.f.layoutdesign.support.SwingLayoutBuilder.composeGroup
     (SwingLayoutBuilder.java:194)
  at o.n.m.f.layoutdesign.support.SwingLayoutBuilder.fillGroup
     (SwingLayoutBuilder.java:213)
  at o.n.m.f.layoutdesign.support.SwingLayoutBuilder.composeGroup
     (SwingLayoutBuilder.java:194)
  at o.n.m.f.layoutdesign.support.SwingLayoutBuilder.fillGroup
     (SwingLayoutBuilder.java:215)
  at o.n.m.f.layoutdesign.support.SwingLayoutBuilder.composeGroup
     (SwingLayoutBuilder.java:194)
  at o.n.m.f.layoutdesign.support.SwingLayoutBuilder.createLayout
     (SwingLayoutBuilder.java:137)
  at o.n.m.f.layoutdesign.support.SwingLayoutBuilder.
     removeComponentsFromContainer(SwingLayoutBuilder.java:113)
  at o.n.m.form.VisualReplicator.removeComponent(VisualReplicator.java:498)
  at org.netbeans.modules.form.FormDesigner$FormListener.run
     (FormDesigner.java:2203)
  ...

java.lang.AssertionError
  at o.n.m.f.layoutdesign.LayoutModel.addInterval(LayoutModel.java:286)
  at o.n.m.f.layoutdesign.LayoutFeeder.addToGroup(LayoutFeeder.java:1017)
  at o.n.m.f.layoutdesign.LayoutFeeder.addInterval(LayoutFeeder.java:728)
  at o.n.m.f.layoutdesign.LayoutFeeder.add(LayoutFeeder.java:285)
  at o.n.m.f.layoutdesign.LayoutDesigner.addComponents(LayoutDesigner.java:759)
  at o.n.m.f.layoutdesign.LayoutDesigner.copyLayout(LayoutDesigner.java:1508)
  at o.n.m.f.CopySupport$RADPaste.doPaste(CopySupport.java:391)
  ...
Comment 9 Tomas Pavek 2007-05-15 00:27:04 UTC
Fixed.

/cvs/form/src/org/netbeans/modules/form/layoutdesign/LayoutDesigner.java
new revision: 1.99; previous revision: 1.98
Comment 10 Jiri Vagner 2007-06-11 15:06:56 UTC
Verified (NetBeans IDE Dev (Build 200706111212))
Comment 11 Jana Maleckova 2007-11-23 08:16:53 UTC
tested on NetBeans IDE 6.0 RC2 (Build 200711201000)