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 9147 - Deleting files causes NullPointerException to get thrown
Summary: Deleting files causes NullPointerException to get thrown
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: Sun Solaris
: P1 major (vote)
Assignee: akemr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-01-18 18:08 UTC by Unknown
Modified: 2008-12-22 22:47 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 Unknown 2001-01-18 18:08:51 UTC
Using the latest open and closed source, I find that if I
try to delete a file (in the Explorer, choose Delete from
the pop up menu for an object), an exception is thrown. The
file is deleted, but this causes problems in my module since
I am deleting more than one file and since the exception
is thrown, only the first file is deleted.

Heres the stack trace I get when I delete a java file:

java.lang.NullPointerException: null
Annotation: Exception occurred in Request Processor
org.openide.util.RequestProcessor$Holder(task
org.netbeans.core.ModuleActions$1@176572 [-4175, 1])
        at
org.openide.util.RequestProcessor$Task.createHolder(RequestProcessor.java:275)
        at org.openide.util.RequestProcessor.post(RequestProcessor.java:99)
        at org.openide.util.RequestProcessor.post(RequestProcessor.java:72)
        at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:65)
        at
org.openide.awt.Actions$ButtonBridge.actionPerformed(Actions.java:298)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:279)
[catch] at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:886)
        at java.awt.Component.processMouseEvent(Component.java:3715)
        at java.awt.Component.processEvent(Component.java:3544)
        at java.awt.Container.processEvent(Container.java:1165)
        at java.awt.Component.dispatchEventImpl(Component.java:2593)
        at java.awt.Container.dispatchEventImpl(Container.java:1214)
        at java.awt.Component.dispatchEvent(Component.java:2497)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2452)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2217)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2126)
        at java.awt.Container.dispatchEventImpl(Container.java:1201)
        at java.awt.Window.dispatchEventImpl(Window.java:912)
        at java.awt.Component.dispatchEvent(Component.java:2497)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:333)
        at
java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)

Thu Jan 18 09:53:47 PST 2001java.lang.NullPointerException: null
java.lang.NullPointerException
        at org.openide.loaders.DataShadow.checkOriginal(DataShadow.java:300)
        at org.openide.loaders.DataShadow.refresh(DataShadow.java:489)
        at org.openide.loaders.DataShadow.checkValidity(DataShadow.java:152)
        at
org.openide.loaders.ShadowChangeAdapter.checkDataShadows(ShadowChangeAdapter.java:50)
        at
org.openide.loaders.ShadowChangeAdapter.operationDelete(ShadowChangeAdapter.java:100)
        at
org.openide.loaders.DataLoaderPool.fireOperationEvent(DataLoaderPool.java:180)
        at
org.openide.loaders.DataObject.fireOperationEvent(DataObject.java:670)
        at org.openide.loaders.DataObject.delete(DataObject.java:491)
        at org.openide.loaders.DataNode.destroy(DataNode.java:203)
        at org.openide.nodes.FilterNode.destroy(FilterNode.java:315)
        at org.openide.explorer.ExplorerActions$1.run(ExplorerActions.java:460)
        at
org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:371)
        at
org.openide.explorer.ExplorerActions$DeleteActionPerformer.performAction(ExplorerActions.java:456)
        at
org.openide.util.actions.CallbackSystemAction.performAction(CallbackSystemAction.java:78)
        at
org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:66)
        at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:67)
        at org.openide.util.Task.run(Task.java:124)
[catch] at
org.openide.util.RequestProcessor$ProcessorThread.run(RequestProcessor.java:562)
Comment 1 Jesse Glick 2001-01-18 18:38:59 UTC
Looks like shadow's original field is null? (Shouldn't DataShadow protected
constructor check for original==null and throw NullPointerException immediately
to make it easier to diagnose the problem?)

FWIW I do not get any exception thrown deleting an object in a current dev
build. If you know what conditions are required to reproduce, please add them.
Comment 2 akemr 2001-01-19 09:25:59 UTC
I cannot reproduce this bug, but I try to fix it somehow:
1) NullPointerException will be thrown immediately in constructor of
DataShadow, if original DataObject is null.
2) checkOriginal(DataObject orig) method, if orig is null, will return null
and then create broken link.
Comment 3 Marian Mirilovic 2002-01-22 13:00:48 UTC
closed