| Summary: | JvmReference causes NullPointerException | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Hendrik Renken <funsheep> | ||||||
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | critical | ||||||||
| Priority: | P3 | CC: | moritz.eysholdt, sebastian.zarnekow, sven.efftinge | ||||||
| Version: | 2.3.0 | Flags: | sven.efftinge:
juno+
|
||||||
| Target Milestone: | RC2 | ||||||||
| Hardware: | Macintosh | ||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Hendrik Renken
Created attachment 210278 [details]
Testcase that crashes the Mwe2-Workflow with a NPE
The testcase. Just try to compile it with the Mwe2-Workflow.
Created attachment 210279 [details]
The Mwe2-Workflow
The workflow file. Execute this to cause the NPE.
workaround: register the Xbase package ;)
This snippet is copied from your workflow:
---
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
// The following two lines can be removed, if Xbase is not used.
// registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
}
---
The NPE is not being thrown if registerGeneratedEPackage is enabled.
Further analysis shows that a metamodel-import inside the super-grammar (which is Xbase) is null. This error, however, is nerver reported as such since LanguageConfig.setUri(String) only validates the grammar that is being loaded, but not its "used" grammars (aka supergrammars). Suggested fix: validate supergrammars in LanguageConfig.setUri(String). fixed in http://git.eclipse.org/c/tmf/org.eclipse.xtext.git/commit/?id=d289400be065f02f7afe5acf5867a17d28888bd1 The imports of all grammars (the one that is loaded and all imported grammars) will now be validated when the grammar is being loaded. The fix will be available with the RC2 release. Requested via bug 522520. -M. Requested via bug 522520. -M. |