Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366376

Summary: ClassCastException when opening invalid Bookmark
Product: z_Archived Reporter: Reto Weingart <reto.weingart>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: judith.gull, ken.lee
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch for BookmarkUtility class
none
Patch for BookmarkUtility class none

Description Reto Weingart CLA 2011-12-12 06:04:22 EST
Build Identifier: M20110210-1200

Generally it is not the case that invalid bookmarks result in a crash of the client. This happened only in a very specific situation. 
Typically the rule for invalid bookmarks is the following: If the bookmark is set to a page (folder page or table page) and this page does not exist anymore below its parent page, the first page below the bookmark's parent page is displayed. If the bookmark's parent page has no child pages, the check goes one level up in the tree to the next parent. 
The specific situation causing the error on startup is the following: If the bookmarked page is of type 'table page' and the type of the first child page of the bookmark's parent page in the new tree is 'folder page', a ClassCastException was thrown. 
As a result, if the user has set his startup view to such an invalid bookmark, the application will not correctly load its desktop and therefore the user cannot work with the application anymore. 
-> Solution: change signature of method bmLoadNodePage in BookmarkUtility class. Patch is attached. 

Reproducible: Always

Steps to Reproduce:
1. Set your user's startup view to a table page where the first child node of the parent is of type folder page. 
2. Remove the table page defined before as startup view. 
3. On startup of the application, the ClassCastException occurs.
Comment 1 Reto Weingart CLA 2011-12-12 06:07:54 EST
Created attachment 208249 [details]
Patch for BookmarkUtility class

Patch contains:
- changed method signature of bmLoadNodePage since second argument was never used anyway
- change all bmLoadNodePage method calls to conform to the new signature

-> With these changes, the described ClassCastException cannot occur anymore
Comment 2 Judith Gull CLA 2013-04-15 04:30:52 EDT
Created attachment 229711 [details]
Patch for BookmarkUtility class
Comment 3 Judith Gull CLA 2013-04-15 04:31:10 EDT
Comment on attachment 229711 [details]
Patch for BookmarkUtility class

new version for 3.9
Comment 4 Judith Gull CLA 2013-04-15 04:35:53 EDT
Thanks for the patch. It makes sense to remove the unused argument. I updated the patch file to match the 3.9 implementation.
No migration needed.
A test is needed for BookmarkUtility.activateBookmark(IDesktop, Bookmark, boolean).
Comment 5 Matthias Nick CLA 2013-10-01 04:41:10 EDT
Works for me. Was not able to reproduce the bug. In my opinion the bug got fixed with the commits in BookmarkUtility over the last years. If it occurs again, please reopen this bug.
Comment 6 Reto Weingart CLA 2013-10-01 05:03:28 EDT
Bug does not occur anymore - Fix successfully verified.
Comment 7 Matthias Zimmermann CLA 2014-07-01 03:21:12 EDT
Shipped with Eclipse Luna Release