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

Bug 369083

Summary: [common.types] ClasspathTypeProvider doesn't find JvmTypes unless they exist on the classpath
Product: [Modeling] TMF Reporter: Moritz Eysholdt <moritz.eysholdt>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow, sven.efftinge
Version: 2.3.0Flags: sven.efftinge: juno+
Target Milestone: M5   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Workaround File 1
none
Workaround File 2 none

Description Moritz Eysholdt CLA 2012-01-19 09:22:46 EST
The ClasspathTypeProvider should also find JvmTypes which do not exist on the classpath but only as derived JvmTypes inside the ResourceSet.

I'll provide patches to fix this.
Comment 1 Sven Efftinge CLA 2012-01-20 03:27:02 EST
I think it should not look into the resource set, but use the IContainer.Manager to look into the index, since derived elements might not be loaded into the ResourceSet yet.

It seems like if you do that it has the behavior of JvmGlobalScopeProvider. Maybe you want to use that?
Comment 2 Sebastian Zarnekow CLA 2012-01-20 04:10:40 EST
It should use the IndexJvmTypeAccess if no Class.forName is present.
Comment 3 Moritz Eysholdt CLA 2012-01-20 05:00:56 EST
Created attachment 209794 [details]
Workaround File 1
Comment 4 Moritz Eysholdt CLA 2012-01-20 05:01:58 EST
Created attachment 209795 [details]
Workaround File 2
Comment 5 Moritz Eysholdt CLA 2012-01-20 05:06:50 EST
The two files are a workaround for this problem. They make sure, IndexedJvmTypeAccess is queried even if classFinder.forName() throws a ClassNotFoundException. The classes subclass the xtext code and can be injected via google guice.
Comment 6 Moritz Eysholdt CLA 2012-01-20 09:18:54 EST
fixed. pushed to master. please review.
Comment 7 Karsten Thoms CLA 2017-09-19 17:46:26 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 8 Karsten Thoms CLA 2017-09-19 17:57:29 EDT
Closing all bugs that were set to RESOLVED before Neon.0