[Uml-devel] kdesdk/umbrello/umbrello/codegenerators
Oliver Kellogg
okellogg at users.sourceforge.net
Fri Dec 17 23:53:01 UTC 2004
CVS commit by okellogg:
getInitialValue(): Make sure parent is truly a UMLAttribute.
M +8 -1 javacodeclassfield.cpp 1.10
--- kdesdk/umbrello/umbrello/codegenerators/javacodeclassfield.cpp #1.9:1.10
@@ -76,5 +76,12 @@ QString JavaCodeClassField::getInitialVa
if (parentIsAttribute())
{
- UMLAttribute * at = (UMLAttribute*) getParentObject();
+ UMLAttribute * at = dynamic_cast<UMLAttribute*>( getParentObject() );
+ if (at) {
+ return fixInitialStringDeclValue(at->getInitialValue(), getTypeName());
+ } else {
+ kdError() << "JavaodeClassField::getInitialValue: parent object is not a UMLAttribute"
+ << endl;
+ return "";
+ }
return fixInitialStringDeclValue(at->getInitialValue(), getTypeName());
}
More information about the umbrello-devel
mailing list