Bug 57005

Summary: Class name with .. : error while creating directory for code genration
Product: [Applications] umbrello Reporter: ep
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: VLO    
Version: 1.1.1   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In:

Description ep 2003-04-08 16:34:06 UTC
Version:           1.1.1 (using KDE KDE 3.1.1)
Installed from:    Debian stable Packages
OS:          Linux

I need to create classes with a double dot in name :
example : String..35, integer..3
(String with maximum length of 35, integer with maximum length of 3)

No problem while creating the class, but while generating code, a warning occured :

"Cannot open file [...]/uml-generated-code/string//35.php for writing. 
Please make sure the directory exists and you have permisions to write to it".

It seems to be a kind of realpath() problem while creating string..35.php, 
(replacing .. by //)...
Comment 1 Luis Carvalho 2003-11-04 12:28:15 UTC
The problem is located in CodeWriter::findFileName().

if the class is associated to a package, the package's name is prepended to the class name and then, all dots are replaced with slashes.

This transformation is correct for a package name, but not for a class name. So, IMHO the replacement of dots with slashes should be done before the package's name is prepended to the class name.
Comment 2 Brian Thomas 2003-12-02 20:02:24 UTC
I believe this is fixed. I tried to generate a code for a class "Weird..Class" and
it appeared to work fine, both with, and without, a package.
Comment 3 Sebastian Stein 2003-12-02 20:13:18 UTC
Subject: Re: [Uml-devel]  Class name with .. : error while creating directory for code genration

Brian Thomas <thomas@mail630.gsfc.nasa.gov> [031202 20:09]:
> I believe this is fixed. I tried to generate a code for a class "Weird..Class" and
> it appeared to work fine, both with, and without, a package.

Does it also work for the old style generators?

Steinchen
Comment 4 Brian Thomas 2003-12-02 23:19:21 UTC
Yes. I tested with php, and xmlschemagenerator..(never mind that a node with ".." in the name is illegal in XML, but thats another issue). These use the older code which has been encorporated into the simpleCodeGenerator class.