Community
Participate
Working Groups
A lot of methods in org.eclipse.papyrus.core.utils.EditorUtils can return null if they don't find what they are designed for. This is documented, but the null value is rarely tested in the actual code. This can throw a NPE later in the code. Especially, this methods relies on the fact that there is an Eclipse active editor, which is not always the case. Normally, only code relying on an active editor, like ui actions, should use these methods. These methods are generally used to get the ServiceRegistry, or a Service like the TransactionalEditingDomain. A recipe describing how to safely get the ServiceRegistry or a service has been added in svn+ssh://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.papyrus/trunk/doc/DevelopperDocuments/cookbook/PapyrusCookBook.odt An action should be taken asap to remove calls to the methods in EditorUtils, has there is potential NPE. The replacement can't be systematic, has it depends on the context of the call.
Created attachment 173771 [details] mylyn/context/zip The classes to use instead of EditorUtils
I close this task which is too generic