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 104399 - NPE - when closing form which contains some controls
Summary: NPE - when closing form which contains some controls
Status: VERIFIED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: App Framework (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-21 10:48 UTC by Jana Maleckova
Modified: 2007-11-22 15:28 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
1. stack trace (4.43 KB, text/plain)
2007-05-21 10:51 UTC, Jana Maleckova
Details
2. stack trace (2.04 KB, text/plain)
2007-05-21 10:51 UTC, Jana Maleckova
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jana Maleckova 2007-05-21 10:48:29 UTC
NetBeans IDE Dev (Build 070521)
1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02
Windows XP version 5.1 running on x86
en_GB (nb); Cp1252

Description:
============
1. have simple java project
2. create jframe and insert some control
3. save and close jFrame
NPE will occur
following IDE's state: in every case when user tries to close form, this
exception occurs. Also inserted button is not possible to delete and ever
attempt ends with exception

StackTrace when form is going to be closed:
===========================================
java.lang.NullPointerException
	at org.netbeans.modules.swingapp.ActionEditor$1.formChanged(ActionEditor.java:118)
	at org.netbeans.modules.form.FormModel.fireEvents(FormModel.java:985)
	at org.netbeans.modules.form.FormModel$EventBroker.run(FormModel.java:1094)
	at
org.netbeans.modules.form.FormModel$EventBroker.sendEventImmediately(FormModel.java:1052)
	at org.netbeans.modules.form.FormModel.sendEventImmediately(FormModel.java:1015)


StackTrace during deleting of inserted button:
===============================================
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
	at java.util.ArrayList.get(ArrayList.java:322)
	at
org.netbeans.modules.form.layoutdesign.LayoutInterval.getSubInterval(LayoutInterval.java:445)
	at
org.netbeans.modules.form.layoutdesign.LayoutDesigner.intervalRemoved(LayoutDesigner.java:3612)
	at
org.netbeans.modules.form.layoutdesign.LayoutDesigner.layoutChanged(LayoutDesigner.java:2184)
Comment 1 Jana Maleckova 2007-05-21 10:51:04 UTC
Created attachment 42590 [details]
1. stack trace
Comment 2 Jana Maleckova 2007-05-21 10:51:39 UTC
Created attachment 42591 [details]
2. stack trace
Comment 3 Joshua Marinacci 2007-05-23 04:41:13 UTC
I have fixed this bug. The FormModelListener will check for nulls. It will also now only be registered once 
and will de-register itself when the form is closed.
Comment 4 Jana Maleckova 2007-05-29 15:54:33 UTC
verified on
NetBeans IDE Dev (Build 200705281800)
1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
Windows XP version 5.1 running on x86
en_GB (nb); Cp1252
Comment 5 Jana Maleckova 2007-11-22 15:28:35 UTC
tested on NetBeans IDE 6.0 RC2 (Build 200711201000)