Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334657 - NullPointerException on multithreaded access to adapters during notify
Summary: NullPointerException on multithreaded access to adapters during notify
Status: RESOLVED INVALID
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-18 10:26 EST by Rudolf Endreß CLA
Modified: 2011-01-18 11:39 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rudolf Endreß CLA 2011-01-18 10:26:58 EST
Build Identifier: M20090917-0800

Used plugin: org.eclipse.emf.common_2.5.0.v200906151043.jar

A multi thread application shows NullPointer Exceptions 
'java.lang..NullPointerException: null
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:280'.

Bug 299808 describes a solution for quite the same problem in 'WTP Java EE Tools': Null pointer check on the adapters within the loop.

I suggest to modify the BasicNotifierImpl in a similar manner.

Reproducible: Sometimes
Comment 1 Ed Merks CLA 2011-01-18 11:39:32 EST
No, we won't put hacks in to mask the fundamental problem.  The list isn't thread safe and any null in the list represents a list that's been corrupted by multi-threaded updates.  Perhaps an adapter that should have been added isn't present or perhaps an adapter that was supposed to be removed isn't. Masking that fact, rather than tracking down how the list is being misused by the application isn't appropriate in the core framework (and probably isn't even appropriate for WTP but that's their own business not mine).