Summary: | import from java code don't read abstract classes | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Enzo Cappa <zcappa> |
Component: | general | Assignee: | Ralf Habacker <ralf.habacker> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ralf.habacker |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/umbrello/27687f8a180685a84729823ce7f84a668c0a3da1 | Version Fixed In: | 2.20.1 (KDE Applications 16.08.1) |
Attachments: |
Print of the class
testcase |
Description
Enzo Cappa
2008-10-28 19:34:25 UTC
Please provide working java test case This bug is more than 7 years old. I don't know if it's still valid, and I'm not using umbrello anymore. I can't provide any further feedback. Feel free to close it if nobody else is interested. @Lays: Please add java files showing this issue to this bug. On the internet there are examples for the usage of abstract classes. Created attachment 98869 [details] Print of the class I had confirmed the bug. The name of the class isn't appearing using *Italic* font, that is the notation of the Abstract Class in UML. This is the code that I used like example: https://paste.kde.org/pelpgwcqe Previous comment about the confirmation of the bug. Ralf, i'm looking to the code to try fix this bug, in the part of the code below, i get confused. The type of comparation using QLatin1String isn't more slow that integer comparison? umlobject.cpp line 1000 if (element.hasAttribute(QLatin1String("abstract"))) { // for bkwd compat. QString abstract = element.attribute(QLatin1String("abstract"), QLatin1String("0")); m_bAbstract = (bool)abstract.toInt(); } else { QString isAbstract = element.attribute(QLatin1String("isAbstract"), QLatin1String("false")); m_bAbstract = (isAbstract == QLatin1String("true")); } BTW, I think that the status isAbstract isn't being set to the UMLObject. javaimport.cpp 421 if (keyword == QLatin1String("abstract")) { m_isAbstract = true; return true; } it returns to: nativeimportbase.cpp 479 if (! parseStmt()) skipStmt(); m_comment.clear(); But I didn't find the place that the data of javaImport is handled, and that I mean, where the data from JavaImport is set to UMLObject. (In reply to Lays Rodrigues from comment #7) > BTW, I think that the status isAbstract isn't being set to the UMLObject. > javaimport.cpp 421 > if (keyword == QLatin1String("abstract")) { > m_isAbstract = true; > return true; > } > it returns to: > nativeimportbase.cpp 479 > if (! parseStmt()) > skipStmt(); > m_comment.clear(); > But I didn't find the place that the data of javaImport is handled, and that > I mean, where the data from JavaImport is set to UMLObject. search for m_isAbstract. You will find several occurences in javaimport.cpp 304: m_klass->setAbstract(m_isAbstract); 549: Import_Utils::insertMethod(m_klass, op, m_currentAccess, typeName, m_isStatic, m_isAbstract, false /*isFriend*/, false /*isConstructor*/, m_comment); Created attachment 100790 [details]
testcase
Git commit 27687f8a180685a84729823ce7f84a668c0a3da1 by Ralf Habacker. Committed on 27/08/2016 at 06:56. Pushed by habacker into branch 'Applications/16.08'. Fix 'Import from java code don't read abstract classes'. Bug is caused by reseting UMLObject::m_isAbstract in UMLClassifier::setBaseType(). A similar bug in C# import is also fixed with this commit. FIXED-IN:2.20.1 (KDE Applications 16.08.1) M +2 -1 umbrello/codeimport/csharp/csharpimport.cpp M +2 -1 umbrello/codeimport/javaimport.cpp http://commits.kde.org/umbrello/27687f8a180685a84729823ce7f84a668c0a3da1 |