Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open .ecore file with empty name #30

Open
sgraband opened this issue Sep 5, 2020 · 0 comments
Open

Can't open .ecore file with empty name #30

sgraband opened this issue Sep 5, 2020 · 0 comments

Comments

@sgraband
Copy link
Contributor

sgraband commented Sep 5, 2020

If an ecore file contains a element that has an empty name, the diagram cannot be opened.

Error:

Expecting @ at index 0 of ''
java.lang.IllegalArgumentException: Expecting @ at index 0 of ''
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eObjectForURIFragmentSegment(BasicEObjectImpl.java:510)
	at org.eclipse.emf.ecore.impl.EModelElementImpl.eObjectForURIFragmentSegment(EModelElementImpl.java:477)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:811)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:787)
	at org.eclipse.emfcloud.ecore.glsp.EcoreFacade.reResolved(EcoreFacade.java:180)
	at org.eclipse.emfcloud.ecore.glsp.EcoreFacade.resolved(EcoreFacade.java:176)
	at org.eclipse.emfcloud.ecore.glsp.EcoreFacade.lambda$findUnresolvedElements$4(EcoreFacade.java:114)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
	at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at org.eclipse.emfcloud.ecore.glsp.EcoreFacade.findUnresolvedElements(EcoreFacade.java:115)
	at org.eclipse.emfcloud.ecore.glsp.EcoreFacade.getOrCreateDiagram(EcoreFacade.java:80)
	at org.eclipse.emfcloud.ecore.glsp.EcoreFacade.getDiagram(EcoreFacade.java:72)
	at org.eclipse.emfcloud.ecore.glsp.model.EcoreModelFactory.loadModel(EcoreModelFactory.java:39)
	at org.eclipse.glsp.server.actionhandler.RequestModelActionHandler.executeAction(RequestModelActionHandler.java:39)
	at org.eclipse.glsp.server.actionhandler.RequestModelActionHandler.executeAction(RequestModelActionHandler.java:31)
	at org.eclipse.glsp.server.actionhandler.BasicActionHandler.execute(BasicActionHandler.java:47)
	at org.eclipse.glsp.server.action.DefaultActionProcessor.dispatch(DefaultActionProcessor.java:52)
	at org.eclipse.glsp.api.action.ActionProcessor.process(ActionProcessor.java:35)
	at org.eclipse.glsp.api.action.ActionProcessor.process(ActionProcessor.java:46)
	at org.eclipse.glsp.server.jsonrpc.DefaultGLSPServer.process(DefaultGLSPServer.java:96)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:830)

Typing in an empty name will be prevented by the model validation #27. However you should still be able to open the diagram, in case you created the model in another editor.

Edit: The problem is with the enotation file containing the empty name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant