Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 294738 - [Viewers] (JFace) Assertion for missing LabelProvider in ViewerColumn
Summary: [Viewers] (JFace) Assertion for missing LabelProvider in ViewerColumn
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5.1   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: 3.6 M4   Edit
Assignee: Boris Bokowski CLA
QA Contact: Boris Bokowski CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-10 09:08 EST by Ralf Ebert CLA
Modified: 2009-12-08 10:06 EST (History)
1 user (show)

See Also:


Attachments
added assertion (1.07 KB, patch)
2009-11-10 09:11 EST, Ralf Ebert CLA
bokowski: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Ebert CLA 2009-11-10 09:08:11 EST
ViewerColumn should throw an AssertionException if the LabelProvider is missing for a column to provide a helpful error message.
Comment 1 Ralf Ebert CLA 2009-11-10 09:11:40 EST
Created attachment 151812 [details]
added assertion
Comment 2 Boris Bokowski CLA 2009-11-11 17:11:12 EST
Wouldn't this potentially break existing code?
Comment 3 Ralf Ebert CLA 2009-11-11 17:43:19 EST
The patch changes a NPE to an AssertionFailedException exception to make it easier to locate a mistake in setting up the ColumnViewer. The NPE can only happen if you forgot to assign a LabelProvider and catching and handling this would be a very weird thing to do.
Comment 4 Boris Bokowski CLA 2009-11-11 21:27:30 EST
You are right, sorry for not realizing this (can be seen by just looking at the patch :-/ ).

Patch released to HEAD.
Comment 5 Remy Suen CLA 2009-12-08 10:06:31 EST
Verified on Windows XP with I20091208-0100. Verified with both a simple test case without a label provider and source code inspection of ViewerColumn.java.

Thanks for the patch, Ralf.