Generating code from the appended xmi file is uncompilable because 1. the class member m_fileVector is of type 'std::vector<File*> while void addFile (File add_object) declaration uses full class 2. same as 1. with void removeFile (File remove_object); 3. The method definitions of 1. are of 'void Folder::addFile (File * add_object)' which differs from the declaration 4. same as 3 with 'void Folder::removeFile (File * remove_object)' 5. Folder::getFileList is defined as 'std::vector<File> getFileList ()' while it is defined as 'std::vector<File *> Folder::getFileList()' How to reproduce: 1. start umbrello and load the appended xmi file 2. Generate c++ code 3. try to compile Folder.cpp What happens: The generated files are uncompilable What is expected: The generated files should be compilable
Created attachment 104565 [details] xmi test case
Yes associations are broken. Am currently investigating what broke it in code.
Created attachment 104820 [details] Simplified Test Case Lesser classes
In CppWriter::writeHeaderAccessorMethodDecl() there is a call to writeAssociationMethods(c->getCompositions(), permitScope, true, INLINE_ASSOCIATION_METHODS, false, c->id(), stream) which deals with compositions. This method generates the File composition in the class Folder *AND* the Folder pointer in the File class. For generating the composition the parameter writePointerVar is set to false to avoid generating classname followed by '*' in the accessor parameter list. Unfortunally writePointerVar = true is required to generate the classname followed by '*' in the accessor methods to m_folder in the File class. So with current code either class Folder is uncompilable or class File is uncompilable.