1. opensymphony
  2. xwork

Commits

mrdon  committed 1658173

Fixed a little bug in the text node parsing patch
XW-412

git-svn-id: http://svn.opensymphony.com/svn/xwork/branches/xwork_1-2@1124e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 81b06ee
  • Branches xwork_1-2

Comments (0)

Files changed (1)

File src/java/com/opensymphony/xwork/config/providers/XmlConfigurationProvider.java

View file
                         String paramName = config.getDefaultResultParam();
                         if (paramName != null) {
                             StringBuffer paramValue = new StringBuffer();
-                            for (int j=0; i<resultElement.getChildNodes().getLength(); i++) {
-                                if (resultElement.getChildNodes().item(i).getNodeType() == Node.TEXT_NODE) {
-                                    String val = resultElement.getChildNodes().item(i).getNodeValue();
+                            for (int j=0; j<resultElement.getChildNodes().getLength(); j++) {
+                                if (resultElement.getChildNodes().item(j).getNodeType() == Node.TEXT_NODE) {
+                                    String val = resultElement.getChildNodes().item(j).getNodeValue();
                                     if (val != null) {
                                         paramValue.append(val);
                                     }
                                 }
                             }
-                            if (paramValue.length() > 0) {
-                                resultParams.put(paramName, paramValue.toString().trim());
+                            String val = paramValue.toString().trim();
+                            if (val.length() > 0) {
+                                resultParams.put(paramName, val);
                             }
                         }
                         else {