svn commit: r18642 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/MetaDataCache.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-08-15 06:01:26-0700
New Revision: 18642

Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/MetaDataCache.java

Log:
Correct index used for loop when building modifiers

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/MetaDataCache.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/MetaDataCache.java?view=diff&pathrev=18642&r1=18641&r2=18642
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/MetaDataCache.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/MetaDataCache.java	2010-08-15 06:01:26-0700
@@ -135,7 +135,8 @@
                 final String propertyName = controlNode.getAttribute("name");
                 final String label = controlNode.getAttribute("label");
                 
-                ControlData controlData = new ControlData(controlNode.getTagName(), propertyName, label);
+                final ControlData controlData =
+                    new ControlData(controlNode.getTagName(), propertyName, label);
                 
                 final String types = controlNode.getAttribute("type");
                 StringTokenizer st = new StringTokenizer(types, ",");
@@ -144,18 +145,7 @@
                 }
                 
                 if (controlNode.getTagName().equals("checkgroup")) {
-                    final NodeList checkBoxNodes = controlNode.getElementsByTagName("checkbox");
-                    for (int k = 0; i < checkBoxNodes.getLength(); ++k) {
-                        Element cbNode = (Element) controlNodes.item(k);
-                        
-                        final String checkBoxType = 
-            	                cbNode.getAttributes().getNamedItem("type").getNodeValue();
-                        final String checkBoxName = 
-                	        cbNode.getAttributes().getNamedItem("name").getNodeValue();
-                        
-                        CheckBoxData cbd = new CheckBoxData(metaTypeByName.get(checkBoxType), checkBoxName);
-                        controlData.addCheckbox(cbd);
-                    }
+                    addCheckboxes(controlData, controlNode);
                 }
                 
                 pm.addControlData(controlData);
@@ -165,5 +155,20 @@
         return map;
     }
     
-    
+    private void addCheckboxes(ControlData controlData, Element controlElement) {
+        final NodeList checkBoxElements =
+            controlElement.getElementsByTagName("checkbox");
+        for (int i = 0; i < checkBoxElements.getLength(); ++i) {
+            Element cbNode = (Element) checkBoxElements.item(i);
+            
+            final String checkBoxType =
+        	cbNode.getAttributes().getNamedItem("type").getNodeValue();
+            final String checkBoxName = 
+    	        cbNode.getAttributes().getNamedItem("name").getNodeValue();
+            
+            CheckBoxData cbd =
+        	new CheckBoxData(metaTypeByName.get(checkBoxType), checkBoxName);
+            controlData.addCheckbox(cbd);
+        }
+    }
 }

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2647121

To unsubscribe from this discussion, e-mail: [[email protected]].
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.