Bug 403913 - [OpenElementService] The OpenElementService does not work with models containing special chars
Summary: [OpenElementService] The OpenElementService does not work with models contain...
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.10.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.10.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-20 12:21 EDT by Camille Letavernier CLA
Modified: 2017-09-08 09:54 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Camille Letavernier CLA 2013-03-20 12:21:41 EDT
Steps to reproduce:

- Create a model with special characters (e.g. a space, Model 1.di)
- Create a Class C
- Save and close the editor
- Start a Papyrus search (Ctrl + H)
- Search for "C"
- The Class C appears in the result. Try to open it. The following exception is thrown:

java.lang.NullPointerException
	at org.eclipse.papyrus.infra.services.openelement.service.impl.OpenElementServiceImpl.openSemanticElement(OpenElementServiceImpl.java:192)
	at org.eclipse.papyrus.infra.services.openelement.service.impl.OpenElementServiceImpl.openSemanticElement(OpenElementServiceImpl.java:117)
	at org.eclipse.papyrus.views.search.results.ModelElementMatch.openElement(ModelElementMatch.java:66)
	at org.eclipse.papyrus.uml.search.ui.pages.PapyrusSearchResultPage.handleOpen(PapyrusSearchResultPage.java:115)
	
And a warning:

The resource doesn't exist: platform:/resource/model/Model%201.di
Comment 1 Camille Letavernier CLA 2013-03-20 12:24:10 EDT
Partially fixed in r10627: The exception is not thrown anymore. The file can still not be found.

Instead of trying to decode the URI to build a valid Eclipse IFile, we should probably directly use the URI to open a Papyrus editor, so that the OpenElementService is CDO-ready.