Community
Participate
Working Groups
Actually when GenEditorGenerator#domainFileExtension (the same -- for #diagramFileExtension) contains ".", the generated CreateWizardPage does not allow to create any diagram ("Resource should have <extension> extension" error message appears even if file actually has it). It is because new Path("abc.def.xyz").getFileExtension().equals("xyz"). Expected -- wizard should allow to create diagrams It is not imaginary case -- in particular, profile definition diagram requires domain resources to have extension "profile.uml"
Also, due to the same reason (that is, generated code uses IPath#getFileExtension() that treats "extension" as "the part after the last dot") generated code incorrectly suggest the "default.extensionPartA2.extensionPartB" name instead of "default2.extensionPartA.extensionPartB" in case of name conflict.
Created attachment 55197 [details] Hopefully fixes the both issues Uses string concatenation instead of IPath operations to workaround IPath extension related behavior.
Well, "part after the dot" is essentially the way to define filename "extension", hence IPath.getFileExtension() is the most legitimate way to get . I doubt this wizard is the only place that fails with such an assumption. I do not see a reason to handle *incorrect* extensions in the generator.
Ok, I agree that "extension with dot" is unnatural, and it is OK that GMF does not support it. However, I am reopening this scr ascking for very little change -- 1. Avoid cryptic error message "File should have profile.uml extension" when file name "blah.profile.uml" is entered. 2. Provide extensibility (via custom templates) of the algorithm that determine the suggested unique file name in case of conflict. This would allow us to fix the problems with Profile diagram, without limitingdefault GMF behavior.
Created attachment 55397 [details] Hopefully fixes the subj (as for reopened version).
reviewed and committed
[target cleanup] 2.0 M4 was the original target milestone for this bug
[GMF Restructure] Bug 319140 : product GMF and component Generation was the original product and component for this bug