Bug 386742

Summary: Wrong namespace assignment of imported base classes with java class import
Product: [Applications] umbrello Reporter: Ralf Habacker <ralf.habacker>
Component: importerAssignee: Umbrello Development Group <umbrello-devel>
Status: ASSIGNED ---    
Severity: normal CC: simonandric5
Priority: NOR    
Version: 2.23.2 (KDE Applications 17.08.2)   
Target Milestone: ---   
Platform: Other   
OS: All   
See Also: https://bugs.kde.org/show_bug.cgi?id=336810
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: test case

Description Ralf Habacker 2017-11-11 10:48:17 UTC
Created attachment 108784 [details]
test case

Importing of the following code fragment places class "BaseClass" in the wrong namespace


How to reproduce:
2. start umbrello
3. select java language
4. import appended test file

What happens:
Inspecting the tree view shows that the class "BaseClass" is located in the top level namespace

What is expected ?
Class "BaseClass" should be located in the namespace "org.kde"
Comment 1 Ralf Habacker 2017-11-11 16:52:24 UTC
Git commit 2e290f0afa8da03bb6b3037759640dbebed5e92e by Ralf Habacker.
Committed on 11/11/2017 at 16:47.
Pushed by habacker into branch 'master'.

Fix 'Wrong namespace assignment of imported base classes with java class import'

In case a referenced base class specified by an import statement is not
found in the file system, use the namespace from the import statement
to avoid placing it in the top level name space.

A java test file is added.
FIXED-IN:2.23.80 (KDE Applications 17.11.80)

A  +7    -0    test/import/java/apackage/DerivedExtern.java
M  +27   -0    umbrello/codeimport/javaimport.cpp

https://commits.kde.org/umbrello/2e290f0afa8da03bb6b3037759640dbebed5e92e
Comment 2 Ralf Habacker 2017-11-11 16:52:24 UTC
Git commit 632759a08198feb39dfc9c22c1e46ff1d82b12fe by Ralf Habacker.
Committed on 11/11/2017 at 16:47.
Pushed by habacker into branch 'master'.

Fix to avoid adding an empty class as return type of the created base class.

M  +7    -5    umbrello/codeimport/javaimport.cpp

https://commits.kde.org/umbrello/632759a08198feb39dfc9c22c1e46ff1d82b12fe