Discussion:
[umbrello] [Bug 401290] New: Regression on import of Java classes with methods using varargs
Oliver Kellogg
2018-11-21 21:19:02 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401290

Bug ID: 401290
Summary: Regression on import of Java classes with methods
using varargs
Product: umbrello
Version: Git
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: importer
Assignee: umbrello-***@kde.org
Reporter: ***@users.sourceforge.net
Target Milestone: ---

Created attachment 116456
--> https://bugs.kde.org/attachment.cgi?id=116456&action=edit
Java classes that have methods with variable arguments

SUMMARY
Regression on import of Java classes with methods using varargs

STEPS TO REPRODUCE
1. cd to your preferred directory for source code to be imported
2. unpack the attachment: tar xvzf java_methods_with_varargs.tar.gz
3. in umbrello, select Code -> Active Language -> Java
4. in umbrello, select Code -> Import from Directory...
5. in the "Select directory to import" dialog, navigate to the top
level directory ("com") created by unpacking the attachment and press OK

OBSERVED RESULT
An object with the name Byte...
already exists in the Logical View.
[new_class]
dito
[new_class_1]
2. When import is finished, a class "Byte..." will appear directly in the
Logical View, along with the additional artifact classes (in this case,
new_class and new_class_1)

EXPECTED RESULT
In version 2.21.70, no such dialog appeared, and
no unwanted artifacts were created.
The type "Byte..." appeared in the Datatypes folder.

I am using 2.26.3 with KF5 18.08.3 and Qt 5.11.
--
You are receiving this mail because:
You are the assignee for the bug.
Oliver Kellogg
2018-11-21 22:14:49 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401290

--- Comment #1 from Oliver Kellogg <***@users.sourceforge.net> ---
Created attachment 116457
--> https://bugs.kde.org/attachment.cgi?id=116457&action=edit
Patch against git master umbrello/codeimport/javaimport.cpp @ be3b42f

This is a preliminary patch to get rid of the dialogs popping up during import
which annoy when the code contains many methods with variable arguments.
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker
2018-11-22 08:49:03 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401290

Ralf Habacker <***@freenet.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@freenet.de

--- Comment #2 from Ralf Habacker <***@freenet.de> ---
Thanks for reporting this issue.

2. When import is finished, a class "Byte..." will appear directly in the
Logical View,

According to
https://cgit.kde.org/umbrello.git/tree/umbrello/codeimport/import_utils.cpp?h=Applications/18.12#n5370c,
method parameter types are forced into the logical view folder. That the type
was stored in the data type folder with version 2.21.70 is probably due to the
fact that the folder assignment was overwritten elsewhere and corrected in the
meantime.
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker
2018-11-22 09:27:05 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401290
A class "Byte..." will appear
https://stackoverflow.com/questions/3158730/java-3-dots-in-parameters says:

"Important Note: The argument(s) passed in this way is always an array - even
if there's just one. Make sure you treat it that way in the method body."

Letting the importer map this to Byte[] let this type be portable to other
languages.
--
You are receiving this mail because:
You are the assignee for the bug.
Oliver Kellogg
2018-11-22 15:23:19 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401290
Post by Ralf Habacker
Letting the importer map this to Byte[] let this type be portable to other
languages.
Nice idea.
Would you like a patch?
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker
2018-11-22 17:26:59 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401290

--- Comment #5 from Ralf Habacker <***@freenet.de> ---
(In reply to Oliver Kellogg from comment #4)
Post by Oliver Kellogg
Post by Ralf Habacker
Letting the importer map this to Byte[] let this type be portable to other
languages.
Nice idea.
Would you like a patch?
Sure, see https://community.kde.org/Get_Involved/development#Submit_your_patch
for submitting details.
--
You are receiving this mail because:
You are the assignee for the bug.
Oliver Kellogg
2018-11-24 16:25:55 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=401290

--- Comment #6 from Oliver Kellogg <***@users.sourceforge.net> ---
Okay, see https://phabricator.kde.org/D17108
--
You are receiving this mail because:
You are the assignee for the bug.
Loading...