[Uml-devel] kdesdk/umbrello/umbrello/codegenerators
Brian Thomas
thomas at mail630.gsfc.nasa.gov
Thu Apr 15 13:23:02 UTC 2004
CVS commit by thomas:
bug fix: java class field declarations shouldnt initialize when classes of objects in question are interfaces..now fixed
M +9 -2 javacodeclassfielddeclarationblock.cpp 1.6
--- kdesdk/umbrello/umbrello/codegenerators/javacodeclassfielddeclarationblock.cpp #1.5:1.6
@@ -19,4 +19,6 @@
#include "javaclassifiercodedocument.h"
#include "javacodegenerationpolicy.h"
+#include "../interface.h"
+#include "../umlrole.h"
// Constructors/Destructors
@@ -90,4 +92,10 @@ void JavaCodeClassFieldDeclarationBlock:
else if (!cf->parentIsAttribute())
{
+ UMLRole * role = dynamic_cast<UMLRole*>(cf->getParentObject());
+ if(dynamic_cast<UMLInterface*>(role->getObject()) )
+ {
+ // do nothing.. can't instanciate an interface
+ } else {
+
// FIX?: IF a constructor method exists in the classifiercodedoc
// of the parent Object, then we can use that instead (if its empty).
@@ -99,4 +107,5 @@ void JavaCodeClassFieldDeclarationBlock:
body.append(" = new Vector ( )");
}
+ }
setText(body+";");
More information about the umbrello-devel
mailing list