[Uml-devel] KDE/kdesdk/umbrello/umbrello/codeimport

Oliver Kellogg okellogg at users.sourceforge.net
Mon Feb 13 20:58:29 UTC 2012


SVN commit 1279959 by okellogg:

(In reply to comment #12)
> [...]
> I see lots of marked-as-duplicates and backtraces but not one single Java
> code attachment to reproduce this with.

Okay, I looked at the marked-as-duplicates such as
      https://bugs.kde.org/show_bug.cgi?id=245933#c2
and it seems we are talking about Java variable-length parameters (three
dots following the type name.) Here is the fix for that.

Import_Utils::createUMLObject(): If typeName.contains("...") then we are
dealing with a Java variable-length parameter. Handle this case specially:
- Set type to UMLObject::ot_Datatype
- Set parentPkg to umldoc->datatypeFolder()
- Set isAdorned false (to preserve ot_Datatype and prevent second creation)

BUG: 230770


 M  +6 -1      import_utils.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/import_utils.cpp #1279958:1279959
@@ -198,7 +198,7 @@
         const bool isConst = name.contains(QRegExp("^const "));
         name.remove(QRegExp("^const\\s+"));
         QString typeName(name);
-        const bool isAdorned = typeName.contains( QRegExp("[^\\w:\\. ]") );
+        bool isAdorned = typeName.contains( QRegExp("[^\\w:\\. ]") );
         const bool isPointer = typeName.contains('*');
         const bool isRef = typeName.contains('&');
         typeName.remove(QRegExp("[^\\w:\\. ].*$"));
@@ -212,6 +212,11 @@
             QStringList components;
             if (typeName.contains("::")) {
                 components = typeName.split("::");
+            } else if (typeName.contains("...")) {
+		// Java variable length arguments
+	        type = UMLObject::ot_Datatype;
+		parentPkg = umldoc->datatypeFolder();
+		isAdorned = false;
             } else if (typeName.contains(".")) {
                 components = typeName.split('.');
             }




More information about the umbrello-devel mailing list