From: SourceForge.net <no...@so...> - 2011-07-01 01:39:41
|
Plugin Patches item #3320018, was opened at 2011-06-17 15:19 Message generated for change (Comment added) made by ezust You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=997937&aid=3320018&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Alan Ezust (ezust) Assigned to: Marcelo Vanzin (vanza) Summary: NPE and InvocationTargetException from ProjectViewer 3.1 git Initial Comment: I've been getting this sometimes when I double-click tree nodes in projectviewer to open files. Not always, just sometimes. java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.gjt.sp.jedit.EditBus.dispatch(EditBus.java:253) at org.gjt.sp.jedit.EditBus.sendImpl(EditBus.java:292) at org.gjt.sp.jedit.EditBus.access$200(EditBus.java:86) at org.gjt.sp.jedit.EditBus$SendMessage.run(EditBus.java:466) at org.gjt.sp.jedit.EditBus.send(EditBus.java:201) at org.gjt.sp.jedit.Buffer$1.run(Buffer.java:291) at org.gjt.sp.util.WorkThreadPool.doAWTRequest(WorkThreadPool.java:396) at org.gjt.sp.util.WorkThreadPool.doAWTRequests(WorkThreadPool.java:381) at org.gjt.sp.util.WorkThreadPool.access$200(WorkThreadPool.java:39) at org.gjt.sp.util.WorkThreadPool$RunRequestsInAWTThread.run(WorkThreadPool.java:481) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641) at java.awt.EventQueue.access$000(EventQueue.java:84) at java.awt.EventQueue$1.run(EventQueue.java:602) at java.awt.EventQueue$1.run(EventQueue.java:600) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:611) 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) Caused by: java.lang.NullPointerException at projectviewer.vpt.ProjectCustomTreeModel.buildPathToRoot(ProjectCustomTreeModel.java:216) at projectviewer.vpt.ProjectCustomTreeModel.getPathToRoot(ProjectCustomTreeModel.java:134) at javax.swing.tree.DefaultTreeModel.nodeStructureChanged(DefaultTreeModel.java:347) at projectviewer.vpt.ProjectCustomTreeModel.addChild(ProjectCustomTreeModel.java:196) at projectviewer.vpt.VPTWorkingFileListModel.fileOpened(VPTWorkingFileListModel.java:70) at projectviewer.vpt.ProjectTreePanel.projectFileOpened(ProjectTreePanel.java:407) at projectviewer.ProjectViewer.handleBufferUpdateMessage(ProjectViewer.java:1085) at projectviewer.ProjectViewer.handleBufferUpdate(ProjectViewer.java:957) ... 27 more ---------------------------------------------------------------------- >Comment By: Alan Ezust (ezust) Date: 2011-06-30 18:39 Message: diff --git a/projectviewer/vpt/ProjectCustomTreeModel.java b/projectviewer/vpt/ProjectCust index 096aa65..bcdd48f 100644 --- a/projectviewer/vpt/ProjectCustomTreeModel.java +++ b/projectviewer/vpt/ProjectCustomTreeModel.java @@ -212,10 +212,12 @@ public abstract class ProjectCustomTreeModel extends ProjectTreeMode } } while (aNode != getRoot()) { + if (aNode == null) break; pathBuilder.add(0, aNode); aNode = aNode.getParent(); } - pathBuilder.add(0, aNode); + if (aNode != null) + pathBuilder.add(0, aNode); return pathBuilder.toArray(new TreeNode[pathBuilder.size()]); } ---------------------------------------------------------------------- Comment By: Alan Ezust (ezust) Date: 2011-06-30 18:36 Message: Attaching a patch which prevents the NPE from happening. Just a null check. Is it as simple as that? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=997937&aid=3320018&group_id=588 |