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 99057 - Save Diagram As dialog accepts invalid characters for new diagram name and NPE
Summary: Save Diagram As dialog accepts invalid characters for new diagram name and NPE
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: General Diagram (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Yang Su
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-27 00:11 UTC by Peter Lam
Modified: 2007-04-10 08:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Lam 2007-03-27 00:11:57 UTC
Diagram name should be validated for valid characters.

Repro steps:
- create a uml project
- create a diagram of any type
- from the project tree
- right click on the diagram node and select Save As
- from the Save Diagram As dialog, enter a new diagram name containing invalid
characters like : ? . / \ 
- press OK
- open the newly saved as diagram that contains invalid chars in the name
Result: The following NPE:

java.lang.NullPointerException
	at
org.openide.util.lookup.InstanceContent$SimpleItem.<init>(InstanceContent.java:150)
	at org.openide.util.lookup.SimpleLookup.<init>(SimpleLookup.java:47)
	at org.openide.util.lookup.Lookups.fixed(Lookups.java:76)
	at
org.netbeans.modules.uml.drawingarea.DiagramTopComponent.getThisLookup(DiagramTopComponent.java:1209)
	at
org.netbeans.modules.uml.drawingarea.DiagramTopComponent.getLookup(DiagramTopComponent.java:1199)
	at
org.netbeans.modules.search.FindActionManager.someoneActivated(FindActionManager.java:176)
	at
org.netbeans.modules.search.FindActionManager.propertyChange(FindActionManager.java:186)
	at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
	at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
	at
org.netbeans.core.windows.RegistryImpl.doFirePropertyChange(RegistryImpl.java:264)
	at org.netbeans.core.windows.RegistryImpl.access$100(RegistryImpl.java:40)
[catch] at org.netbeans.core.windows.RegistryImpl$1.run(RegistryImpl.java:138)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
	at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 1 Peter Lam 2007-03-27 00:16:06 UTC
The diagram icon used on the project tree to represent the newly saved as
diagram is a document instead of the correct diagram type icon. Once the NPE,
nothing can be done to the new opened diagram since every mouse click will pop
up the NPE again.
Comment 2 Yang Su 2007-03-27 19:21:38 UTC
fixed with issue 99076
Comment 3 Peter Lam 2007-04-10 08:26:06 UTC
verified in build 070409_13.
Comment 4 Peter Lam 2007-04-10 08:31:00 UTC
I closed this one since issue 99076 contains a more complete list of invalid
characters. As a result, the complete set of invalid chars have not been
verified in this bug.
Comment 5 Peter Lam 2007-04-10 08:31:59 UTC
ops, submitted too fast ;-)
I closed this one mainly for the NPE that is no longer coming up.