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 106147 - NPE on removing package from scoped diagram after some modifications
Summary: NPE on removing package from scoped diagram after some modifications
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: General (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Yang Su
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2007-06-08 17:48 UTC by Andrew Korostelev
Modified: 2007-06-27 10:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
java.lang.NullPointerException (1.15 KB, text/plain)
2007-06-08 17:49 UTC, Andrew Korostelev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Korostelev 2007-06-08 17:48:39 UTC
NPE on removing package from scoped diagram after some specific modifications.

steps:
- create uml project
- create class diagram in the root of the model
- create package in the root ofthe model
- drag package to diagram drawing area
- drag-n-drop diagram node into package node in model tree.
- put new class to the diagram
- save all
- remove package symbol on diagram
- select 'deletion will permamently ...' checkbox in opened delete dialog.
- press yes button

BUG: save diagram dialog appears

press 'Yes'

java.lang.NullPointerException will appear.
Comment 1 Andrew Korostelev 2007-06-08 17:49:45 UTC
Created attachment 43449 [details]
java.lang.NullPointerException
Comment 2 Yang Su 2007-06-14 00:10:16 UTC
I can't reproduce the NPE with latest build, but fixed the issue that would trigger it. The cause was the logic that
sets diagram dirty state when 'Delete' key was pressed. 
Comment 3 Andrew Korostelev 2007-06-20 14:55:24 UTC
reproducible in netbeans-hudson-trunk-980-full (Build 070620)
There was a problem with project types When issue was filed.
Now it is clear that issue is reproducible for independent uml project only.

steps:
- create independent uml project
- create package with scoped class diagram
- drag package from tree to scoped diagram
- save all
- remove package symbol on diagram
- select 'deletion will permamently ...' checkbox in opened delete dialog.
- press yes button

PROBLEM1: save diagram dialog appears

- press 'Yes'

PROBLEM2: java.lang.NullPointerException will appear.
Comment 4 Yang Su 2007-06-25 23:49:56 UTC
I can reproduce the issue now,it's really a race condition among several event threads, the reason it does not show on
java platform project is that another dialog for package deletion pops up which has an impact on code execution timing.

Made changes in DiagramTopComponent.canClose() to check if diagram is meant to be deleted (drawing control object's
destroy() has been invoked), so that in this situation the save diagram dialog will not be invoked.
Comment 5 Andrew Korostelev 2007-06-27 10:15:05 UTC
verified in netbeans-hudson-trunk-1233-full(Build 070627)