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
problem.

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: Sat Apr 20 01:16:35 GMT 2024

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

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

Back to the top