Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311324

Summary: NPE in AbstractContainer#findAllEObjects
Product: [Modeling] TMF Reporter: Michael Clay <clay>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: 1.0.0Flags: sebastian.zarnekow: helios+
Target Milestone: M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 311323    
Bug Blocks:    

Description Michael Clay CLA 2010-05-02 17:27:12 EDT
to reproduce:

prereq: java project with xtext nature and enabled auto build 

1. create a file named bar.dmodel containing

entity Bar {
}

2. create a file named foo.dmodel containing

entity Foo {
    attr bar : Bar
}

3. within the package explorer select,copy and paste the bar.dmodel file to
create a file copy 
i.e. accept the suggested default and name it  'Copy of bar.dmodel' file 

4. within the package explorer select and DELETE the previously created 'Copy of bar.dmodel' file 

stacktrace:

java.lang.NullPointerException
	at org.eclipse.xtext.resource.impl.AbstractContainer$2.apply(AbstractContainer.java:36)
	at org.eclipse.xtext.resource.impl.AbstractContainer$2.apply(AbstractContainer.java:1)
	at com.google.common.collect.Iterators$10.next(Iterators.java:662)
	at com.google.common.collect.Iterators$10.next(Iterators.java:661)
	at com.google.common.collect.Iterators$6.hasNext(Iterators.java:477)
	at org.eclipse.xtext.scoping.impl.ContainerBasedScope.getContentByName(ContainerBasedScope.java:46)
	at org.eclipse.xtext.linking.impl.ImportedNamesAdapter$WrappingScope.getContentByName(ImportedNamesAdapter.java:52)
	at org.eclipse.xtext.scoping.impl.MapBasedScope.getContentByName(MapBasedScope.java:36)
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:106)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:79)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:219)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:202)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:262)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1475)
	at org.eclipse.xtext.example.domainmodel.impl.TypeRefImpl.getReferenced(TypeRefImpl.java:76)
	at org.eclipse.xtext.example.domainmodel.impl.TypeRefImpl.eGet(TypeRefImpl.java:120)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1013)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1005)
	at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.hasNext(EContentsEList.java:409)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolveCrossReferences(EcoreUtil.java:307)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:287)
	at org.eclipse.xtext.resource.impl.DefaultResourceDescription.getImportedNames(DefaultResourceDescription.java:97)
	at org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager.getImportedNames(DefaultResourceDescriptionManager.java:92)
	at org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager.isAffected(DefaultResourceDescriptionManager.java:88)
	at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport.isReparseRequired(DirtyStateEditorSupport.java:352)
	at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob$1.exec(DirtyStateEditorSupport.java:120)
	at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob$1.exec(DirtyStateEditorSupport.java:1)
	at org.eclipse.xtext.util.concurrent.IStateAccess$AbstractImpl.readOnly(IStateAccess.java:40)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:58)
	at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob.run(DirtyStateEditorSupport.java:113)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Sebastian Zarnekow CLA 2010-05-03 10:08:04 EDT
Fixed in HEAD.
Comment 2 Karsten Thoms CLA 2017-09-19 16:32:28 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.