Author: tfmorris
Date: 2007-07-25 13:20:36-0700
New Revision: 13146
Modified:
trunk/src/model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java
Log:
Don't log warning on special property 'remove'. Add some Java 5 generic types
Modified: trunk/src/model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java?view=diff&rev=13146&p1=trunk/src/model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java&p2=trunk/src/model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java&r1=13145&r2=13146
==============================================================================
--- trunk/src/model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java (original)
+++ trunk/src/model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java 2007-07-25 13:20:36-0700
@@ -100,7 +100,7 @@
private Map elements = Collections.synchronizedMap(new HashMap());
/**
- * Map of Class/attribute tupes and the listeners they have registered.
+ * Map of Class/attribute tuples and the listeners they have registered.
*/
private Map listenedClasses = Collections.synchronizedMap(new HashMap());
@@ -850,7 +850,7 @@
return;
}
- HashSet names = new HashSet();
+ HashSet<String> names = new HashSet<String>();
// If we don't have a MofClass, see if we can get one from the
// instance
if (!(metaobject instanceof MofClass)) {
@@ -864,14 +864,10 @@
}
MofClass metaclass = (MofClass) metaobject;
- for (Iterator it = metaclass.allSupertypes().iterator(); it
- .hasNext();) {
- MofClass superclass = (MofClass) it.next();
+ for (MofClass superclass : (List<MofClass>)metaclass.allSupertypes()) {
// TODO: This won't find associations which aren't navigable in
// this direction
- List contents = superclass.getContents();
- for (Iterator i2 = contents.iterator(); i2.hasNext();) {
- Object o = i2.next();
+ for (Object o : superclass.getContents()) {
if (o instanceof javax.jmi.model.Reference
|| o instanceof javax.jmi.model.Attribute) {
names.add(((javax.jmi.model.ModelElement) o).getName());
@@ -879,8 +875,9 @@
}
}
- for (int i = 0; i < attributes.length; i++) {
- if (!names.contains(attributes[i])) {
+ for (String attribute : attributes) {
+ if (!names.contains(attribute)
+ && !"remove".equals(attribute)) {
/*
* TODO: For any names not found in the class definition,
* see if we can find an association with an end of the
@@ -890,7 +887,7 @@
* all associations, check the types of their association
* ends for one which matches our class, then get the name
*/
- LOG.error("Property '" + attributes[i]
+ LOG.error("Property '" + attribute
+ "' for class '"
+ metaclass.getName()
+ "' doesn't exist in metamodel"
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.