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.
Summary: | Cannot copy-paste a container with a custom layout manager | ||
---|---|---|---|
Product: | guibuilder | Reporter: | chiss <chiss> |
Component: | Code | Assignee: | issues@guibuilder <issues> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | pkeegan |
Priority: | P2 | ||
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Windows ME/2000 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | The custom layout manager I use. |
Description
chiss
2003-03-14 18:37:10 UTC
Created attachment 9413 [details]
The custom layout manager I use.
I get following exceptions (printed in console): java.lang.InstantiationException: org.netbeans.modules.form.layoutsupport.DefaultLayoutSupport at java.lang.Class.newInstance0(Class.java:281) at java.lang.Class.newInstance(Class.java:249) at org.netbeans.modules.form.layoutsupport.AbstractLayoutSupport.cloneLayoutSupport(AbstractLayoutSupport.java:753) at org.netbeans.modules.form.layoutsupport.LayoutSupportManager.copyLayoutDelegateFrom(LayoutSupportManager.java:227) at org.netbeans.modules.form.MetaComponentCreator.makeCopy(MetaComponentCreator.java:519) at org.netbeans.modules.form.MetaComponentCreator.copyComponent2(MetaComponentCreator.java:294) ... java.lang.NullPointerException at org.netbeans.modules.form.layoutsupport.LayoutSupportManager.copyLayoutDelegateFrom(LayoutSupportManager.java:230) at org.netbeans.modules.form.MetaComponentCreator.makeCopy(MetaComponentCreator.java:519) at org.netbeans.modules.form.MetaComponentCreator.copyComponent2(MetaComponentCreator.java:294) ... The immediate problem is in that class org.netbeans.modules.form.layoutsupport.DefaultLayoutSupport cannot be instantiated using Class.newInstance(). There is also architectural flaw behind - it's not taken into account that copying of layout may fail... Fixed in trunk. /cvs/form/src/org/netbeans/modules/form/layoutsupport/AbstractLayoutSupport.java new revision: 1.37; previous revision: 1.36 /cvs/form/src/org/netbeans/modules/form/layoutsupport/DefaultLayoutSupport.java new revision: 1.4; previous revision: 1.3 Now thinking if this should go to NB 3.5. Wow, that was fast ! About your comment on if it should go to 3.5 or not, I would say yes because other people like me going from 3.4.1 to 3.5 (when its officially released) will most likely report the problem.... But I understand there are probably a dozens of steps to take to make sure your fix doesn't affect anything else, QA and stuff... Your call. Thanks again, Francis It would be no problem to put this to NB 3.5 - if it was last week. But now we are already in stage when only P1 bugs ("showstoppers") can be fixed. This is surely ugly bug, P2 at least, but I'm not sure if it is showstopper. Otherwise the fix is quite simple. Doh ! Oh well.. Maybe we can put something in the release notes about it, or something... There is an easy workaround : just change the layout to a "default" one, like FlowLayout, do the copy, and then put back the desired "custom" layout. Until next bug ;-) Okay, let's add this to release notes (readme.html): It is not possible to copy/paste containers with custom (i.e. non-standard) layout managers. A workaround is to set the layout e.g. to FlowLayout first, then do the copy, and then set the right layout back again. adding to the 3.5 readme. Thanks for the text, Tomas. The issue is not regression, I successfully reproduced it in release 3.4.1 build. Now it works fine with the fix in trunk - verified in dev build #200304150100. removing RELNOTE keyword |