Bug 368484 - java import resolves templated class type into wrong java source
Summary: java import resolves templated class type into wrong java source
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.9.5
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-09 09:57 UTC by Ralf Habacker
Modified: 2016-10-12 09:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.20.2 (KDE Applications 16.08.2)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2016-09-09 09:57:06 UTC
Importing main.java from the following files:

--- file Test.java
public class Test<T> {
    // T stands for "Type"
    private T t;

    public void set(T t) { this.t = t; }
    public T get() { return t; }
}

--- file main.java -------
import Test;
public class main {
    Test<Integer> integerBox;
}
using the following command line on linux:

strace -e trace=file  umbrello

shows that umbrello tries to open the following path

...../Test<Integer>.java 

which indicates that the java import tries to open an invalid java source file. 

Reproducible: Always

Steps to Reproduce:
1. save mentioned test case into related files
2. run umbrello with strace -e trace=file umbrello
4. switch active language to 'java' and import main.java


Actual Results:  
strace shows something like .../Test<Integer>.java 

Expected Results:  
strace should show that umbrello is loading .../Test.java

At least with version 2.9.5 the bug is present, but bug may be older.
Comment 1 Ralf Habacker 2016-09-09 10:00:14 UTC
Git commit c990500e7204e5bd92a7ab5f94d95f2ebc8ea98d by Ralf Habacker.
Committed on 09/09/2016 at 09:59.
Pushed by habacker into branch 'Applications/16.08'.

Fix 'java import resolves templated class type into wrong java source'.
FIXED-IN:2.10.2 (KDE Applications 16.08.2)

M  +6    -0    umbrello/codeimport/javaimport.cpp

http://commits.kde.org/umbrello/c990500e7204e5bd92a7ab5f94d95f2ebc8ea98d