Bug 256716 - Umbrello 1.5.8 crashes when Generate code function is used.
Summary: Umbrello 1.5.8 crashes when Generate code function is used.
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian stable Linux
: NOR crash
Target Milestone: ---
Assignee: Oliver Kellogg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-12 16:53 UTC by German
Modified: 2014-08-08 17:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.13.97
Sentry Crash Report:


Attachments
To test crash generating all code with umbrello 1.5.8 (29.37 KB, text/x-xmi)
2010-11-12 16:54 UTC, German
Details
XMI file purged of artifacts (28.54 KB, text/x-xmi)
2012-02-15 05:32 UTC, Oliver Kellogg
Details
Crash of current git master on loading attachment 68812 (4.22 KB, text/plain)
2014-07-25 04:51 UTC, Oliver Kellogg
Details

Note You need to log in before you can comment on or make changes to this bug.
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