Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343661 - UnsupportedOperation NullJdtTypeProvider.createResource(URI) called
Summary: UnsupportedOperation NullJdtTypeProvider.createResource(URI) called
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-22 12:55 EDT by Karsten Thoms CLA
Modified: 2017-09-19 17:21 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: indigo+


Attachments
Screenshot: Popup dialog (45.27 KB, image/png)
2011-04-22 12:55 EDT, Karsten Thoms CLA
no flags Details
Screenshot: Debugger #1 (274.37 KB, image/png)
2011-04-22 12:56 EDT, Karsten Thoms CLA
no flags Details
Screenshot: Debugger #2 (383.13 KB, image/png)
2011-04-22 12:56 EDT, Karsten Thoms CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Thoms CLA 2011-04-22 12:55:44 EDT
Created attachment 193929 [details]
Screenshot: Popup dialog

I am facing often a popup error message, which is caused by calling the method NullJdtTypeProvider.createResource(URI). The URI passed in here is java:/Object/java.lang.Object. I cannot really tell how to reproduce it, but it happens for me often just when saving an .xtext file, and also in other situations.

Meybe the stacktrace can help a bit. See also screenshots from debugger.

Thread [Worker-56] (Suspended (exception UnsupportedOperationException))	
	NullJdtTypeProvider.createResource(URI) line: 49	
	SynchronizedXtextResourceSet(ResourceSetImpl).createResource(URI, String) line: 425	
	SynchronizedXtextResourceSet(ResourceSetImpl).demandCreateResource(URI) line: 239	
	SynchronizedXtextResourceSet(ResourceSetImpl).getResource(URI, boolean) line: 391	
	SynchronizedXtextResourceSet.getResource(URI, boolean) line: 23	
	SynchronizedXtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 216	
	TypeReferences.findDeclaredType(Class<?>, EObject) line: 180	
	TypeReferences.getTypeForName(Class<?>, EObject, JvmTypeReference...) line: 143	
	XtendOverridesService.allSuperOperations(JvmDeclaredType) line: 74	
	XtendOverridesService.findOverriddenOperation(JvmOperation) line: 61	
	XtendOverridesService.findOverriddenOperation(XtendFunction) line: 55	
	XtendOverridesService.getOverriddenReturnType(XtendFunction) line: 85	
	Xtend2TypeProvider.getDeclaredOrOverriddenReturnType(XtendFunction) line: 231	
	Xtend2TypeProvider._typeForIdentifiable(XtendFunction, boolean) line: 163	
	GeneratedMethodAccessor35.invoke(Object, Object[]) line: not available	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	PolymorphicDispatcher<RT>.invoke(Object...) line: 291	
	AbstractTypeProvider$4.doComputation(JvmIdentifiableElement, boolean) line: 270	
	AbstractTypeProvider$4.doComputation(EObject, boolean) line: 1	
	AbstractTypeProvider$CyclicHandlingSupport$3.get() line: 432	
	AbstractTypeProvider$CyclicHandlingSupport$3.get() line: 1	
	AbstractTypeProvider$1.get(Object, Resource, Provider<T>) line: 107	
	AbstractTypeProvider$4(AbstractTypeProvider$CyclicHandlingSupport<T>).getType(T, boolean) line: 429	
	Xtend2TypeProvider(AbstractTypeProvider).doGetType(String, T, boolean, CyclicHandlingSupport<T>) line: 190	
	Xtend2TypeProvider(AbstractTypeProvider).getTypeForIdentifiable(JvmIdentifiableElement, boolean) line: 284	
	Xtend2TypeProvider(AbstractTypeProvider).getTypeForIdentifiable(JvmIdentifiableElement) line: 280	
	Xtend2Resource.inferReturnType(JvmOperation) line: 117	
	Xtend2Resource.getEObject(String) line: 82	
	SynchronizedXtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 219	
	EcoreUtil.resolve(EObject, ResourceSet) line: 202	
	EcoreUtil.resolve(EObject, EObject) line: 262	
	JvmOperationImpl(BasicEObjectImpl).eResolveProxy(InternalEObject) line: 1483	
	JvmOperationImpl.getReturnType() line: 208	
	JvmOperationImpl.eGet(int, boolean, boolean) line: 306	
	JvmOperationImpl(BasicEObjectImpl).eGet(EStructuralFeature, boolean, boolean) line: 1021	
	JvmOperationImpl(BasicEObjectImpl).eGet(EStructuralFeature, boolean) line: 1013	
	EContentsEList$ResolvingFeatureIteratorImpl<E>(EContentsEList$FeatureIteratorImpl<E>).hasNext() line: 409	
	EContentsEList$ResolvingFeatureIteratorImpl<E>(EContentsEList$FeatureIteratorImpl<E>).next() line: 565	
	EcoreUtil$2(AbstractTreeIterator<E>).next() line: 139	
	Xtend2Resource(LazyLinkingResource).resolveLazyCrossReferences(CancelIndicator) line: 95	
	EcoreUtil2.resolveLazyCrossReferences(Resource, CancelIndicator) line: 417	
	DefaultResourceDescription.getImportedNames() line: 95	
	DefaultResourceDescriptionManager.getImportedNames(IResourceDescription) line: 95	
	DefaultResourceDescriptionManager.isAffected(IResourceDescription$Delta, IResourceDescription) line: 91	
	DirtyStateEditorSupport.isReparseRequired(XtextResource, IResourceDescription$Event) line: 365	
	DirtyStateEditorSupport$UpdateEditorStateJob$1.exec(XtextResource) line: 123	
	DirtyStateEditorSupport$UpdateEditorStateJob$1.exec(Object) line: 1	
	XtextDocument$XtextDocumentLocker(AbstractReadWriteAcces<P>).readOnly(IUnitOfWork<T,P>) line: 32	
	XtextDocument.readOnly(IUnitOfWork<T,XtextResource>) line: 86	
	DirtyStateEditorSupport$UpdateEditorStateJob.run(IProgressMonitor) line: 116	
	Worker.run() line: 54
Comment 1 Karsten Thoms CLA 2011-04-22 12:56:06 EDT
Created attachment 193930 [details]
Screenshot: Debugger #1
Comment 2 Karsten Thoms CLA 2011-04-22 12:56:22 EDT
Created attachment 193931 [details]
Screenshot: Debugger #2
Comment 3 Sebastian Zarnekow CLA 2011-04-23 13:13:13 EDT
Karsten, which Xtext version do you use? Could you please provide the build id?
Comment 4 Karsten Thoms CLA 2011-04-26 04:37:33 EDT
2.0.0.v201104211304

Maybe worth to mention: I had the same project in the workspace checked out as subfolder. Means that I have checked out the root of a branch where my projects (the domainmodel example) where within subfolders. And the projects existed also as top-level projects. Maybe this causes the situation?
Comment 5 Sebastian Zarnekow CLA 2011-04-26 17:15:11 EDT
If not IJavaProject can be found for a given IResource, a NullJdtTypeProvider is configured for the project. It should not throw an UnsupportedOperationException. We should try to find a way to handle this situation gracefully.
Comment 6 Sebastian Zarnekow CLA 2011-04-27 13:28:21 EDT
I'll try to create an empty resource with the given URI. That should do the trick.
Comment 7 Sebastian Zarnekow CLA 2011-04-27 13:35:37 EDT
Pushed to master. Please verify.
Comment 8 Karsten Thoms CLA 2017-09-19 17:09:34 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 9 Karsten Thoms CLA 2017-09-19 17:21:29 EDT
Closing all bugs that were set to RESOLVED before Neon.0