Issue Details (XML | Word | Printable)

Key: AGROSENSE-1388
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Tom Verhage
Reporter: Timon Veenstra
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
agrosense

NullPointer exception when removing a cropfield using the action in the layer list

Created: 13/Jan/13 04:30 PM   Updated: 23/Jan/13 12:18 PM   Resolved: 22/Jan/13 10:03 AM
Component/s: Field, Geoviewer
Affects Version/s: 12.12
Fix Version/s: 13.01

Time Tracking:
Not Specified

Tags:
Participants: Merijn Zengers, Timon Veenstra and Tom Verhage


 Description  « Hide
  • create a field
  • create a production unit
  • drag the field to the production unit.
  • put the cropfield on the map and split it.
  • remove one of the cropfields by choosing "remove cropfield" action in the layerlist context menu
    EXPECTED: cropfield is removed from the production unit and from the map
    ACTUAL: NullPointer Exception

note: cropfield is removed from the production unit and from the map, so the error seems mainly cosmetical



Timon Veenstra added a comment - 13/Jan/13 04:30 PM

java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:332)
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:987)
at nl.cloudfarming.client.model.EntityCache$DefaultImpl.get(EntityCache.java:106)
at nl.cloudfarming.client.model.AbstractEntityManager.find(AbstractEntityManager.java:52)
at nl.cloudfarming.client.productionunit.RemoveCropFieldAction.actionPerformed(RemoveCropFieldAction.java:61)
[catch] at org.openide.awt.InjectorAny.actionPerformed(InjectorAny.java:73)
at org.openide.awt.ContextAction$Performer.actionPerformed(ContextAction.java:226)
at org.openide.awt.ContextManager.actionPerformed(ContextManager.java:247)
at org.openide.awt.ContextAction.actionPerformed(ContextAction.java:109)
at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:93)
at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116)
at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99)
at org.openide.awt.GeneralAction$BaseDelAction.actionPerformed(GeneralAction.java:234)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:696)
at java.awt.EventQueue$4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:158)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)


Merijn Zengers added a comment - 22/Jan/13 10:03 AM

Caused by the fact that the map has two nodes in the lookup which represent the same original node. The Layer list has a layer node and the map has a filternode. On remove the parent uri of the cropfield is set to null then another run occurs where the parent uri is needed.

Added review request under http://cloudfarming-review.appspot.com/109001


Merijn Zengers added a comment - 23/Jan/13 11:05 AM

Pushed in

changeset: 2795:ccfa81278ace
tag: tip
user: Merijn Zenges <merijn.zengers@gmail.com>
date: Wed Jan 23 12:04:54 2013 +0100
summary: AGROSENSE-1388


Tom Verhage added a comment - 23/Jan/13 12:18 PM

Tested 23-01-2013, works as expected now.