We found the following behavior in NSMDF (current cvs
version):
MOFModelPackageImpl::refAllAssociations() runs into an
exception.
After investigating the source some time, we found out that
the meta association "DependsOn" causes the error.
MOFModelPackageImpl::createMetaObject(Class cls) does
not recognize derived associations
(as seen in GenMMImplPackage::generateCreateMetaObject() )
Because refAllAssociations tries to return "DependsOn",
createMetaObject() throws the exception.
The following java sniplet demonstrates the error.
Because the UML metamodel does not contain derived
associations, the first block does NOT fail. The second
block crashes in the last line.
[Run with CLASSPATH=nsmdf.jar:nsuml.jar]
Class c =
Class.forName("ru.novosoft.uml.impl.UMLUMLPackageImpl");
RefPackage umlModel = (RefPackage)c.newInstance();
umlModel.refAllAssociations();
Class c1 =
Class.forName("ru.novosoft.mdf.mof.impl.model.MOFModelPackageImpl");
ModelPackage model = (ModelPackage)c1.newInstance();
model.refAllAssociations();
FIX? :
After commenting out the "if(!asc.isDerived()" ...
it seems to work, although we did not do much testing.
The JMI Spec. says the API is the same for derived
associations as for non-derived associations, so we
expect refAllAssociations() to return derived
associations as well.
Arne Lindow, Fabian Büttner
University of Bremen