Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Viewer, ISelection, and non-null-element contract
Viewer, ISelection, and non-null-element contract [message #721646] Fri, 02 September 2011 12:12
Eclipse UserFriend
Originally posted by:

Several parts of the Viewer API seem to assume that the contained
elements (in a selection or in the Viewer) cannot be null values. E.g.
the StructuredSelection constructor requires this for it's input or
StructuredViewer#getRawChildren does validate this. But these are either
internal checks or documentation for some very specific implementation
(StructuredSelection) and what I'm missing is a more general contract
that applies to e.g. for IStructuredSelection and
IStructuredContentProvider (or at least on a viewer level) and the like
to return elements that are not null. The lack of this contract has the
effect that third-party implementations of Viewers or selection
providers can easily lead to NPE that are produce deep within some
internal Eclipse machinery (my last example: The object contribution
evaluation) and which is hard to track down to the actual root of the

Is my assumption correct in regard to this implied contract?
If so, I would strongly argue in favour for a documentation of this
contract as part of the interfaces or abstract types, not only for some
specific implementations.

Thanks & Greetings from Bremen,

Daniel Kr├╝gler
Previous Topic:[Forms] Header layout problem caused by message icons
Next Topic:Removing objects in TreeViewer - performance issue
Goto Forum:

Current Time: Wed Jun 20 02:28:08 GMT 2018

Powered by FUDForum. Page generated in 0.01402 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top