SUMMARY Umbrello can do better when importing incomplete Java sources STEPS TO REPRODUCE 1. Unpack the attachment in an empty directory of your choice 2. In Umbrello select Code -> Active Language -> Java 3. In Umbrello select Code -> Import from Directory... and navigate to the directory where you unpacked the attachment, then press OK OBSERVED RESULT Umbrello opens a dialog: " An object with the name foo already exists in the package org. Please enter a new name: " EXPECTED RESULT No such dialog interaction is needed.
Created attachment 125066 [details] org-foo-bar.tar.gz The tarfile contains a file org/bar/util/UniqueKey.java which has a line: public interface UniqueKey extends org.foo.notexist.NotAvailable { However, the file org/foo/notexist/NotAvailable.java is not contained in the tarfile.
Git commit 616c0ec319241b8742b2e88b356e66fd63ff7b3f by Oliver Kellogg. Committed on 12/01/2020 at 18:14. Pushed by okellogg into branch 'release/19.12'. Optmization in JavaImport: Skip object creation for method "void" return umbrello/codeimport/javaimport.cpp - In function parseStmt(), on parsing a type name (of a member of class or interface, or return type an operation), call resolveClass only if typeName is not "void". M +1 -1 umbrello/codeimport/javaimport.cpp https://invent.kde.org/kde/umbrello/commit/616c0ec319241b8742b2e88b356e66fd63ff7b3f
Git commit f23904618a4f40d54092152614a0b1df37f0b5f8 by Oliver Kellogg. Committed on 12/01/2020 at 18:33. Pushed by okellogg into branch 'release/19.12'. Improve creation of generalization with parent provided as string: umbrello/codeimport/import_utils.cpp - In function createGeneralization(UMLClassifier*, const QString&), if parentName contains a scope separator then - split the qualified name into its parts using the scope separator as the divider; - save the last element of the split list as className and pop that element off the list; - declare local variables `parent' and `current' of type UMLPackage*; - iterate over the list and create each package path segment using the 7 argument form of Import_Utils::createUMLObject(); - on iterating, use the variables `parent' and `current' to track the UML packages created, such that the path segments are assembled with the proper hierarchical nesting; - after the package creation loop, create the className object using the 7 argument form of Import_Utils::createUMLObject() and using `parent' as the parent package. M +25 -1 umbrello/codeimport/import_utils.cpp https://invent.kde.org/kde/umbrello/commit/f23904618a4f40d54092152614a0b1df37f0b5f8
(In reply to Oliver Kellogg from comment #3) > Git commit f23904618a4f40d54092152614a0b1df37f0b5f8 by Oliver Kellogg. > BUG:416178 This bug will not be in the list of "new Umbrello 2.30 features" (https://umbrello.kde.org/news.php#itemUmbrello230releasesavailable) if this line is missing. FIXED-IN: 2.30.2 (KDE Release 19.12.2)
(In reply to Ralf Habacker from comment #4) > [...] > This bug will not be in the list of "new Umbrello 2.30 features" > (https://umbrello.kde.org/news.php#itemUmbrello230releasesavailable) if this > line is missing. > > FIXED-IN: 2.30.2 (KDE Release 19.12.2) Eek, I forgot that. Thanks for adding it here in the PR.
Git commit 8c1bfa64f1c822e2853e5f248a24a00adfda6ccb by Oliver Kellogg. Committed on 12/01/2020 at 21:16. Pushed by okellogg into branch 'release/19.12'. Improvement to import of incomplete Java source code: umbrello/model_utils.cpp - In function findUMLObject, if object names match but types are different then add further test: If the source object is a Package or a Class and the found object has the class-or-package stereotype applied then return the found object. M +10 -0 umbrello/model_utils.cpp https://invent.kde.org/kde/umbrello/commit/8c1bfa64f1c822e2853e5f248a24a00adfda6ccb