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.
Build: NetBeans IDE Dev (Build 200911291400) VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01 OS: Linux, 2.6.31-15-generic, i386 User Comments: aldobrucale: Moving a cpp file Stacktrace: java.lang.NullPointerException at org.netbeans.modules.cnd.makeproject.api.configurations.Item.renameTo(Item.java:138) at org.netbeans.modules.cnd.makeproject.api.configurations.Item.propertyChange(Item.java:229) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276) at org.openide.loaders.DataObject.firePropertyChange(DataObject.java:922) at org.openide.loaders.DataObject.move(DataObject.java:727)
Created attachment 91860 [details] stacktrace
Can not reproduce it in RC1. Please investigate if the bug exists only in trunk. aldobrucale, could you please provide a detailed scenario to reproduce this bug.
How do you move the file? Drag & Drop, Cut & Paste, or ?. And from Projects window?
I moved the file via drag and drop in the "projects window", and it was a "Project with Existing Sources". The project is versioned under mercurial. I've just tried to move another file, but nothing happened.
The problem confirmed. It's a showstopper for FCS. Please fix it ASAP. Scenario: - create local litesql-0.3.5 project - expand 'src' in the projects view - move any file (drag&drop) from one folder to another one (e.g. backend.cpp from 'library' to 'generator') Result: NPE occurs.
My stacktrace seems to be slightly different: java.lang.NullPointerException at org.netbeans.modules.cnd.makeproject.api.configurations.ItemConfiguration.getCCCompilerConfiguration(ItemConfiguration.java:242) at org.netbeans.modules.cnd.makeproject.api.configurations.ItemConfiguration.assignValues(ItemConfiguration.java:371) at org.netbeans.modules.cnd.makeproject.ui.MakeLogicalViewProvider$ViewItemPasteType.copyItemConfigurations(MakeLogicalViewProvider.java:1231) at org.netbeans.modules.cnd.makeproject.ui.MakeLogicalViewProvider$ViewItemPasteType.paste(MakeLogicalViewProvider.java:1262) at org.openide.explorer.view.DragDropUtilities.performPaste(DragDropUtilities.java:197) at org.openide.explorer.view.TreeViewDropSupport.drop(TreeViewDropSupport.java:770) at java.awt.dnd.DropTarget.drop(DropTarget.java:434) at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500) at sun.awt.X11.XDropTargetContextPeer.processDropMessage(XDropTargetContextPeer.java:165) at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(SunDropTargetContextPeer.java:812) at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:736) at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:30) at java.awt.Component.dispatchEventImpl(Component.java:4487) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:4309) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4163) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2475) at java.awt.Component.dispatchEvent(Component.java:4460) [catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:125) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
See also bug #177890 It also has a similar stacktrace and scenario. Apparently we have a common problem in the background. Please fix both issues.
fixed: http://hg.netbeans.org/cnd-main/rev/72726856e54e
The fix is verified in dev-build. Please review the fix and push it into release68 clone.
Reopened until it's integrated into release68 clone.
I'm having trouble reproducing this bug (before your fix) and don't quite understand why it is failing. Can you, please, explain why you think the exception happens and how your fix fixes this?
I have tested it thoroughly and don't see any problems with the fix, but please see my comment from before? Please explain what went wrong before your fix and how your fix fixes this.
OK, here is what I think is going on: if you move a file using drag&drop (and possible other methods) *while* the project is being analyzed ('Analyzing' is shoing in status bar), you get the exception. If you wait until the project has been analyzed, everything is fine. The analyzer phase may take less or more time depending on project size and cpu/disk speed so you may not always see the error. The project is incomplete until the analyzing phase has completed and certain operations like moving files are unsafe. If this assessment is correct, I wonder if the 'fix' is correct. Please explain.
Analyzing phase consists from several internal steps: 1. get project items 2. read file system 3. analyze dwarf information 4. prepare configuration 5. write project items Potential conflict can be only on step number 5. The probability of it is low because step duration is small. So IMHO use case in your last comment is hardly reproduced and at first failure will be in discovery.
Integrated into 'main-golden', will be available in build *200912020200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/72726856e54e User: Vladimir Voskresensky <vv159170@netbeans.org> Log: fixed IZ#177856: [68cat] NullPointerException at org.netbeans.modules.cnd.makeproject.api.configurations.Item.renameTo
(In reply to comment #12) > I have tested it thoroughly and don't see any problems with the fix, but please > see my comment from before? Please explain what went wrong before your fix and > how your fix fixes this. 1) It is reproducible in Files view on Solaris 2) It is reproducible in Project view on Linux the issue is caused by mixing NB file events && D&D handling. A) the fix in renameTo checks that folder.addItem was successful. It is "not" when item already added in project in this folder. That could happen if file events come twice. B) in setFolder I do not set folder to this.folder=folder if folder is "null". Otherwise copying configurations doesn't work even when configurations are stored as array or ItemConfiguration[] (ItemConfiguration has field of item which then asks item.getFolder().getConfiguration and NPE
I'm sure there are a lot of other problems and this infrastructure needs careful redesign in 6.9 timeframe
integrated into 68 http://hg.netbeans.org/release68?cmd=changeset;node=0fdad7657b91
verified in RC2 build 2009-12-02_22-00-34