Bug 336889 - Generating code for PHP5 is corrupted when generations comes from inheritance from class and interface
Summary: Generating code for PHP5 is corrupted when generations comes from inheritance...
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.11.5
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
: 191038 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-06-30 08:03 UTC by Sebastian
Modified: 2014-08-24 15:59 UTC (History)
2 users (show)

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


Attachments
error1 (460.39 KB, image/png)
2014-06-30 08:04 UTC, Sebastian
Details
error2 (423.25 KB, image/png)
2014-06-30 08:04 UTC, Sebastian
Details
simplified xmi test case (11.13 KB, application/x-uml)
2014-06-30 11:59 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian 2014-06-30 08:03:35 UTC
Generating code for PHP5 is corrupted when generations comes from inheritance from class and interface (see error1.png)
Workaround:
delete connection with interface from child class dialog window (very importand!), connect child with interface again ;)
Remeber to save(and regenerate your code too) after every step.

Reproducible: Always

Steps to Reproduce:
1.Make interface and parent class
2. make child class
3. connect interface and than parent class with child
Comment 1 Sebastian 2014-06-30 08:04:05 UTC
Created attachment 87483 [details]
error1
Comment 2 Sebastian 2014-06-30 08:04:20 UTC
Created attachment 87484 [details]
error2
Comment 3 Ralf Habacker 2014-06-30 10:26:24 UTC
According to http://stackoverflow.com/questions/652157/can-a-class-extend-both-a-class-and-implement-an-interface should the generated code be valid. 
Also running this class through a php5 (5.4.20) interpreter do not produce any error, while it reports a syntax error if I exchange the terms 'extends' and 'implements'. 
What I can see is that for that case (one extends and one or multiple implements)  the warning is obsolate and should be removed.

May this be an issue of the NetBeans IDE ?
Comment 4 Ralf Habacker 2014-06-30 11:36:03 UTC
(In reply to comment #3)
> According to
> http://stackoverflow.com/questions/652157/can-a-class-extend-both-a-class-
> and-implement-an-interface should the generated code be valid. 
> Also running this class through a php5 (5.4.20) interpreter do not produce
> any error, while it reports a syntax error if I exchange the terms 'extends'
> and 'implements'. 
> What I can see is that for that case (one extends and one or multiple
> implements)  the warning is obsolate and should be removed.
> 
> May this be an issue of the NetBeans IDE ?

Looks not, the screenshot did not show that the generated class ArticleWsInt contains a method declaration for getArticlesByContent() and and an "implements"  methods shown in the screenshot with the same name. 

The problem looks like that UMLClassifier::getRealizations() returns a realization from self for class ArticleWsInt, although it do not use any realizations.
Comment 5 Ralf Habacker 2014-06-30 11:55:36 UTC
Git commit 11f59ca774e9ff1131c115ae1a03a7c27df96dd6 by Ralf Habacker.
Committed on 30/06/2014 at 11:51.
Pushed by habacker into branch 'master'.

php5 generator fix: Hide misleading warning when using single inheritance and multiple implementations which is supported by php5.

M  +1    -1    umbrello/codegenerators/php/php5writer.cpp
M  +3    -1    umbrello/umlcanvasobject.cpp
M  +1    -1    umbrello/umlcanvasobject.h

http://commits.kde.org/umbrello/11f59ca774e9ff1131c115ae1a03a7c27df96dd6
Comment 6 Ralf Habacker 2014-06-30 11:59:42 UTC
Created attachment 87490 [details]
simplified xmi test case
Comment 7 Ralf Habacker 2014-06-30 12:28:43 UTC
Git commit 9ffb8eb81d5e3f0df1c011502633ff6224518d78 by Ralf Habacker.
Committed on 30/06/2014 at 12:24.
Pushed by habacker into branch 'master'.

PHP5 writer fix: Exclude realization to self, which creates additional wrong 'implement' methods on interface classes.

It is currently unknown why there is an realization to self, which may also affect other code generators.

M  +4    -0    umbrello/codegenerators/php/php5writer.cpp

http://commits.kde.org/umbrello/9ffb8eb81d5e3f0df1c011502633ff6224518d78
Comment 8 Ralf Habacker 2014-06-30 13:07:02 UTC
Git commit 1809908a8c2794b9fb8e01c4677ab8a2fcc1c878 by Ralf Habacker.
Committed on 30/06/2014 at 11:51.
Pushed by habacker into branch 'KDE/4.13'.

php5 generator fix: Hide misleading warning when using single inheritance and multiple implementations which is supported by php5.
FIXED-IN:4.13.3
(cherry picked from commit 11f59ca774e9ff1131c115ae1a03a7c27df96dd6)

M  +1    -1    umbrello/codegenerators/php/php5writer.cpp
M  +3    -1    umbrello/umlcanvasobject.cpp
M  +1    -1    umbrello/umlcanvasobject.h

http://commits.kde.org/umbrello/1809908a8c2794b9fb8e01c4677ab8a2fcc1c878
Comment 9 Ralf Habacker 2014-06-30 13:07:05 UTC
Git commit 0144f78c14130db99c76ddfae48f5518b62fd4a3 by Ralf Habacker.
Committed on 30/06/2014 at 12:24.
Pushed by habacker into branch 'KDE/4.13'.

PHP5 writer fix: Exclude realization to self, which creates additional wrong 'implement' methods on interface classes.

It is currently unknown why there is a realization to self, which may also affect other code generators.
FIXED-IN:4.13.3
(cherry picked from commit 9ffb8eb81d5e3f0df1c011502633ff6224518d78)

M  +4    -0    umbrello/codegenerators/php/php5writer.cpp

http://commits.kde.org/umbrello/0144f78c14130db99c76ddfae48f5518b62fd4a3
Comment 10 Joris Steyn 2014-08-24 15:59:49 UTC
*** Bug 191038 has been marked as a duplicate of this bug. ***