Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369083 - [common.types] ClasspathTypeProvider doesn't find JvmTypes unless they exist on the classpath
Summary: [common.types] ClasspathTypeProvider doesn't find JvmTypes unless they exist ...
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.3.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-19 09:22 EST by Moritz Eysholdt CLA
Modified: 2017-09-19 17:57 EDT (History)
2 users (show)

See Also:
sven.efftinge: juno+


Attachments
Workaround File 1 (1.94 KB, text/plain)
2012-01-20 05:00 EST, Moritz Eysholdt CLA
no flags Details
Workaround File 2 (2.17 KB, text/plain)
2012-01-20 05:01 EST, Moritz Eysholdt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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