Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366376 - ClassCastException when opening invalid Bookmark
Summary: ClassCastException when opening invalid Bookmark
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-12 06:04 EST by Reto Weingart CLA
Modified: 2021-08-19 11:03 EDT (History)
2 users (show)

See Also:


Attachments
Patch for BookmarkUtility class (1.65 KB, patch)
2011-12-12 06:07 EST, Reto Weingart CLA
no flags Details | Diff
Patch for BookmarkUtility class (1.86 KB, patch)
2013-04-15 04:30 EDT, Judith Gull CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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