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 204750 - NullPointerException at org.netbeans.modules.form.HandleLayer.shouldHighlightPanel
Summary: NullPointerException at org.netbeans.modules.form.HandleLayer.shouldHighlight...
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-07 09:52 UTC by Exceptions Reporter
Modified: 2011-11-07 14:20 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 38867


Attachments
stacktrace (1.83 KB, text/plain)
2011-11-07 09:52 UTC, Exceptions Reporter
Details
Test-case (13.48 KB, application/x-zip-compressed)
2011-11-07 14:04 UTC, Jan Stola
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2011-11-07 09:52:13 UTC
This issue was reported manually by mmirilovic.
It already has 23 duplicates 


Build: NetBeans IDE 6.9.1 (Build 201011082200)
VM: Java HotSpot(TM) 64-Bit Server VM, 17.1-b03, Java(TM) SE Runtime Environment, 1.6.0_22-b04
OS: Windows 7

User Comments:
GUEST: Opened the IDE.
Changeed the Text in one TextField and compiled, ,giving this error.

GUEST: 1
Comment 1 Exceptions Reporter 2011-11-07 09:52:16 UTC
Created attachment 112909 [details]
stacktrace
Comment 2 Marian Mirilovic 2011-11-07 09:56:33 UTC
Too old, last report from 6.9.1
Comment 3 Jan Stola 2011-11-07 13:52:06 UTC
The exception is thrown on the following line:

if (realParent.getSize().equals(realPanel.getSize()) && realPanel.getLocation().equals(new Point(0,0))) {

i.e., realPanel or realParent is null. My guess is that realParent is null. In other words, there is some component that

* is replicated
* is not top-design component
* has parent
* its parent is not replicated

It probably cannot happen in normal component hierarchy, but it can happen when some component is displayed in another component as a result of property setting.

Steps to reproduce (in NetBeans 7.0.1)
1. Create Java Desktop application.
2. Add JPanel into mainPanel of the view form.
3. Select [FrameView] and change its component property to jPanel1.
4. Save the form, close it adn reopen it.
5. Move mouse cursor over the central area of the form
   => the exception is thrown.
Comment 4 Jan Stola 2011-11-07 14:04:08 UTC
Created attachment 112924 [details]
Test-case

This bug is not specific to Java Desktop application. I am attaching a standalone test-case.

Steps to reproduce:
1. Open the attached project.
2. Build the project.
3. Open PanelForm.
4. Select problematicComponent.
5. Change value of its 'component' property to 'component'.
6. Move mouse over the problematicComponent
   => the exception is thrown.
Comment 5 Jan Stola 2011-11-07 14:20:27 UTC
Fixed.

Modified file: http://hg.netbeans.org/jet-main/rev/3a27e136d39c