Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333999 - IllegalStateException when opening file with capitalized extension
Summary: IllegalStateException when opening file with capitalized extension
Status: CLOSED INVALID
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-11 11:32 EST by Mark Christiaens CLA
Modified: 2011-01-11 12:05 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Christiaens CLA 2011-01-11 11:32:51 EST
Build Identifier: M20100909-0800

When I open a file with a capitalized extension (so ".VHD" instead of ".vhd") then I get this error and no editor window is opened.  When I rename the file to lowercase then I can open the editor.

!ENTRY org.eclipse.ui 4 0 2011-01-11 17:26:03.059
!MESSAGE Unable to create editor ID com.sigasi.xtext.VHDLLang: Editor could not be initialized.
!STACK 0
java.lang.IllegalStateException: The resource factory registered for platform:/resource/ArkanoidTest/TEA1.VHD does not yield an XtextResource. Make sure the file name extension is correct (case matters).
	at org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:77)
	at org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResourceFor(ResourceForIEditorInputFactory.java:69)
	at org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:61)

I found this bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=322434 that seems similar.  It suggests to add every combination of capitalized extensions so I did:

...
var file.extensions = "vhdl,Vhdl,vHdl,VHdl,vhDl,VhDl,vHDl,VHDl,vhdL,VhdL,vHdL,VHdL,vhDL,VhDL,vHDL,VHDL,vhd,Vhd,vHd,VHd,vhD,VhD,vHD,VHD"
...

The error persists. 

Reproducible: Always
Comment 1 Mark Christiaens CLA 2011-01-11 11:33:14 EST
I'm using Xtext 2.0 M4
Comment 2 Jan Koehnlein CLA 2011-01-11 11:38:00 EST
Are plugin.xml and plugin.xml_gen in sync?
Comment 3 Mark Christiaens CLA 2011-01-11 11:55:18 EST
No, they're not in sync.  I see your point.  I have to merge them.  I'll give it a go.
Comment 4 Mark Christiaens CLA 2011-01-11 12:05:36 EST
I've replaced plugin.xml with the generated one and now it works.  Closing report as invalid.  Thanks.