[Uml-devel] branches/KDE/3.5/kdesdk/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Mon Mar 20 09:44:04 UTC 2006


SVN commit 520749 by okellogg:

Restore code generation for static methods in the old and new generator.
Emit "void" for an unspecified return type in the new generator.
BUG:59190


 M  +1 -0      ChangeLog  
 M  +2 -0      umbrello/codegenerators/javacodegenerator.cpp  
 M  +4 -2      umbrello/codegenerators/javacodeoperation.cpp  
 M  +1 -1      umbrello/codegenerators/javawriter.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #520748:520749
@@ -1,6 +1,7 @@
 Version 1.5.3
 
 * Bugs/wishes from http://bugs.kde.org:
+* Static variables in java code are not marked static (5591190)
 * Save autosave file to a more obvious place (72019)
 
 Version 1.5.2
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/codegenerators/javacodegenerator.cpp #520748:520749
@@ -142,6 +142,8 @@
 // Same thing again for "bool" to "boolean"
 QString JavaCodeGenerator::fixTypeName(QString string)
 {
+    if (string.isEmpty() || string.contains(QRegExp("^\\s+$")))
+        return "void";
     string.replace(QRegExp("^string$"),"String");
     string.replace(QRegExp("^bool$"),"boolean");
     return cleanName(string);
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/codegenerators/javacodeoperation.cpp #520748:520749
@@ -66,9 +66,11 @@
         if (paramNum != nrofParam )
             paramStr  += ", ";
     }
+    QString maybeStatic;
+    if (o->getStatic())
+        maybeStatic = "static ";
+    QString startText = strVis + " " + maybeStatic + returnType + methodName + " (" + paramStr + ")";
 
-    QString startText = strVis + " "+ returnType + methodName + " ( "+paramStr+")";
-
     // IF the parent is an interface, our operations look different
     // e.g. they have no body
     if(isInterface) {
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/codegenerators/javawriter.cpp #520748:520749
@@ -738,8 +738,8 @@
 
         str = ""; // reset for next method
         str += ((op->getAbstract() || isInterface) ? "abstract ":"");
-        str += (op->getStatic() ? "static":"");
         str += scopeToJavaDecl(op->getVisibility()) + " ";
+        str += (op->getStatic() ? "static ":"");
         str += methodReturnType + " " +cleanName(op->getName()) + "( ";
 
         atl = op->getParmList();




More information about the umbrello-devel mailing list