http://argouml.tigris.org/issues/show_bug.cgi?id=5017
------- Additional comments from [email protected] Tue Aug 30 19:27:55 -0700 2011 -------
Based in the comment by Ludger Solbach (with Patrick Hilsbos) - thanks - I
managed to confirm that it is possible to have the error solved for the default
UML 1.4 core profile, the Java profile and the C++ profile. Missing is to check
if it also works for user defined profiles.
The fix is only for UML 1.4 and the MDR implementation: FacadeMDRImpl and
XmiReaderImpl.
XmiReaderImpl:
public Map<String, Object> getXMIUUIDToObjectMap() {
if (resolver != null) {
Map<String, Map<String, Object>> idToObjectMaps =
resolver.getIdToObjectMaps();
Set<Entry<String,Map<String,Object>>> entrySet = null;
synchronized (idToObjectMaps) {
entrySet =
new
HashSet<Entry<String,Map<String,Object>>>(idToObjectMaps.entrySet());
for (Entry<String, Map<String, Object>> entry : entrySet) {
entry.setValue(new HashMap<String,Object>(entry.getValue()));
}
}
HashMap<String, Object> globalXmiIdToObjectMap = new HashMap<String,
Object>();
for (Entry<String, Map<String, Object>> entry : entrySet) {
String xmiIdPrefix =
entry.getKey().startsWith("file:/tmp/zargo_model_") ? "" :
entry.getKey() + "#";
for (Map.Entry<String, Object> innerMapEntry :
entry.getValue().entrySet()) {
globalXmiIdToObjectMap.put(
xmiIdPrefix + innerMapEntry.getKey(),
innerMapEntry.getValue());
}
}
return globalXmiIdToObjectMap;
}
return null;
}
FacadeMDRImpl:
public String getUUID(Object base) {
try {
if (base instanceof RefBaseObject) {
String mofId = ((RefBaseObject) base).refMofId();
// Look for an existing reference matching our MofID
XmiReference ref = ((XmiReference) modelImpl
.getObjectToId().get(mofId));
if (ref == null) {
return mofId;
} else if
(!ref.getSystemId().startsWith("file:/tmp/zargo_model_")) {
return ref.getSystemId() + "#" + ref.getXmiId();
} else {
return ref.getXmiId();
}
}
} catch (InvalidObjectException e) {
throw new InvalidElementException(e);
}
return illegalArgumentString(base);
}
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=448&dsMessageId=2833248
To unsubscribe from this list, e-mail: [[email protected]].
Please do not reply to this mail. Instead, add your comments in the issue.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.