Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 375515 - Deleting a bookmark folder structure throws NullPointerException
Summary: Deleting a bookmark folder structure throws NullPointerException
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-28 07:39 EDT by Michael Schaufelberger CLA
Modified: 2021-08-19 11:19 EDT (History)
1 user (show)

See Also:
zimmermann: indigo+
zimmermann: juno+


Attachments
Patch to avoid the NullPointerException (1.49 KB, application/octet-stream)
2012-03-28 07:39 EDT, Michael Schaufelberger CLA
hannes.mueller: iplog+
hannes.mueller: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Schaufelberger CLA 2012-03-28 07:39:13 EDT
Created attachment 213283 [details]
Patch to avoid the NullPointerException

Steps to reproduce the problem:
1) Create a bookmark folder structure, e.g.
    Folder a
    - Folder b
    - - Folder c
    - - - Folder (or Bookmark) d
2) Delete a folder that contains at least one subfolder which contains another folder or bookmark (Folder b or Folder a in the example above)
3) A confirmation message is shown. Note the order of the nodes listed. If the order is from leaf to selected node (d, c, b in the example above) there is no problem => create another example. Otherwise (e.g. ordered c, b, d) the problem can be reproduced => click "Yes"
4) The folder structure is deleted correctly, but a NullPointerException is thrown:
ProcessingException[ProcessingStatus[ERROR code=0 Unexpected exception java.lang.NullPointerException]]
	at org.eclipse.scout.rt.client.ui.action.AbstractAction$P_UIFacade.fireActionFromUI(AbstractAction.java:605)
	at org.eclipse.scout.rt.ui.swing.action.SwingScoutAction$1.run(SwingScoutAction.java:146)
	at org.eclipse.scout.rt.ui.swing.concurrency.SwingScoutSynchronizer$1.runVoid(SwingScoutSynchronizer.java:66)
	at org.eclipse.scout.rt.client.ClientJob.runStatus(ClientJob.java:177)
	at org.eclipse.scout.rt.client.ClientJob.runTransactionWrapper(ClientJob.java:161)
	at org.eclipse.scout.rt.client.ClientJob.run(ClientJob.java:149)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.NullPointerException
	at org.eclipse.scout.rt.client.ui.desktop.bookmark.AbstractBookmarkTreeField$FolderNode$DeleteMenu.execAction(AbstractBookmarkTreeField.java:657)
	at org.eclipse.scout.rt.client.ui.action.AbstractAction.doAction(AbstractAction.java:297)
	at org.eclipse.scout.rt.client.ui.action.AbstractAction$P_UIFacade.fireActionFromUI(AbstractAction.java:598)
	... 6 more


At AbstractBookmarkTreeField.java:657, getTree() returns null for one of the iterations in the for loop. When we use the local variable "tree" and do a null check after resolving the parent node at AbstractTree:1233, it works.

See patch attached.

This patch is probably more kind of a workaround, so maybe someone who is more familiar with those classes may provide a better solution.
Comment 1 Hannes Mueller CLA 2012-04-20 07:33:39 EDT
patch applied and tested
Comment 2 Matthias Zimmermann CLA 2013-07-08 17:36:39 EDT
Bugfixes shipped on Scout 3.7 branch