[Uml-devel] kdesdk/umbrello/umbrello/codegenerators

Sebastian Stein seb.kde at hpfsc.de
Mon Jun 16 01:25:26 UTC 2003


CVS commit by sstein: 

Fix for Bug 59190:

Static variables were marked as final in the generated source code. Final and static are not the same. A final variable can only be changed one time in the program, a static variable can be changed as often as you like, but in each object of a class the static variable has allways the same value, because it only exists one time for all instances of a class.

We should think if getter/setter methods for static variable should also be static!

CCMAIL: 59190-close at bugs.kde.org


  M +4 -4      javawriter.cpp   1.12


--- kdesdk/umbrello/umbrello/codegenerators/javawriter.cpp  #1.11:1.12
@@ -313,5 +313,5 @@ void JavaWriter::writeAttributeDecls(QPt
         {
                 QString documentation = at->getDoc();
-                QString staticValue = at->getStatic() ? "final " : "";
+                QString staticValue = at->getStatic() ? "static " : "";
                 QString typeName = fixTypeName(at->getTypeName());
                 QString initialValue = fixInitialStringDeclValue(at->getInitialValue(), typeName);
@@ -326,5 +326,5 @@ void JavaWriter::writeAttributeDecls(QPt
                 QString documentation = at->getDoc();
                 QString typeName = fixTypeName(at->getTypeName());
-                QString staticValue = at->getStatic() ? "final " : "";
+                QString staticValue = at->getStatic() ? "static " : "";
                 QString initialValue = fixInitialStringDeclValue(at->getInitialValue(), typeName);
                 if(!documentation.isEmpty())
@@ -338,5 +338,5 @@ void JavaWriter::writeAttributeDecls(QPt
                 QString documentation = at->getDoc();
                 QString typeName = fixTypeName(at->getTypeName());
-                QString staticValue = at->getStatic() ? "final " : "";
+                QString staticValue = at->getStatic() ? "static " : "";
                 QString initialValue = fixInitialStringDeclValue(at->getInitialValue(), typeName);
                 if(!documentation.isEmpty())
@@ -719,5 +719,5 @@ void JavaWriter::writeOperations(QPtrLis
                 str = ""; // reset for next method
                 str += ((op->getAbstract() || isInterface) ? "abstract ":"");
-                str += (op->getStatic() ? "final":"");
+                str += (op->getStatic() ? "static":"");
                 str += scopeToJavaDecl(op->getScope()) + " ";
                 str += methodReturnType + " " +cleanName(op->getName()) + "( ";






More information about the umbrello-devel mailing list