Bug 256716

Summary: Umbrello 1.5.8 crashes when Generate code function is used.
Product: [Applications] umbrello Reporter: German <germanach>
Component: generalAssignee: Oliver Kellogg <okellogg>
Status: RESOLVED FIXED    
Severity: crash CC: okellogg, ralf.habacker
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In: 4.13.97
Attachments: To test crash generating all code with umbrello 1.5.8
XMI file purged of artifacts
Crash of current git master on loading attachment 68812

Description German 2010-11-12 16:53:00 UTC
Version:           unspecified (using KDE 1.2) 
OS:                Linux

umbrello crash with no warning if particular 4 clases UML to java Generate All Code event is executed, generating only 2 source files.

Reproducible: Didn't try

Steps to Reproduce:
1. Install debian stable.
2. Install umbrello.
3. Open my particular umbrello .xmi file.
4. Set Active Language to java. 
5. In Code Generation Settings Set: General: Language = java, all other default.
6. Select Code in menu, and Generate All Code or by the Code Generation Wizzard (same result).

Actual Results:  
package: logica
class: CsvTools.java  Pc.java
generated and program dies with no warning or message.

Expected Results:  
All files should be created and umbrello program continue running.

the tecnica.xmi umbrello file is attached.
Comment 1 German 2010-11-12 16:54:41 UTC
Created attachment 53367 [details]
To test crash generating all code with umbrello 1.5.8

To test crash generating all code with umbrello 1.5.8
Comment 2 Oliver Kellogg 2012-02-15 05:32:26 UTC
Created attachment 68812 [details]
XMI file purged of artifacts

This is an Umbrello problem, deletion does not always work as it should.
If you delete a class that has asociations, the associations tend to remain (although the class is deleted.) When you reload the XMI file, Umbrello will detect the dangling association ends and will create an artificial datatype named "undef" so that the association ends point to some defined object.
See also https://bugs.kde.org/show_bug.cgi?id=293042#c6 ff.

In the attached file, I have cleaned out the associations that have the "undef" object as an end point. Thus the code generation works.
Comment 3 Oliver Kellogg 2012-02-15 05:33:09 UTC

*** This bug has been marked as a duplicate of bug 293042 ***
Comment 4 Oliver Kellogg 2014-07-25 04:51:14 UTC
Created attachment 87940 [details]
Crash of current git master on loading attachment 68812 [details]
Comment 5 Oliver Kellogg 2014-07-25 04:59:01 UTC
Git commit 555f2fb306d41c1bc9a4f29da79c420efd7ecdd0 by Oliver Kellogg.
Committed on 25/07/2014 at 04:59.
Pushed by okellogg into branch 'master'.

umbrello/codegenerators/java/javacodeaccessormethod.cpp
- In function updateMethodDeclaration(), if javafield->getFieldName()
  returns empty then abort update with error.

umbrello/codegenerators/codegen_utils.cpp function capitalizeFirstLetter()
- Do not attempt accesses into string when empty.

M  +2    -0    umbrello/codegenerators/codegen_utils.cpp
M  +4    -0    umbrello/codegenerators/java/javacodeaccessormethod.cpp

http://commits.kde.org/umbrello/555f2fb306d41c1bc9a4f29da79c420efd7ecdd0