portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r774365 - /portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/desktop/core.src.js
Date Wed, 13 May 2009 13:46:56 GMT
Author: woonsan
Date: Wed May 13 13:46:56 2009
New Revision: 774365

URL: http://svn.apache.org/viewvc?rev=774365&view=rev
Log:
JS2-1008: Fixing infinite loop problem in javascript by wrong array index usage. Should have
used non-index loop.

Modified:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/desktop/core.src.js

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/desktop/core.src.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/desktop/core.src.js?rev=774365&r1=774364&r2=774365&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/desktop/core.src.js
(original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/desktop/core.src.js
Wed May 13 13:46:56 2009
@@ -572,13 +572,13 @@
                 {
                     var headTagElemsByMergeHintArray = headTagElemsByMergeHint[mergeHint];
                     var lines = childNode.text.split(/\n/);
-                    for (var i = 0; i < lines.length; i++)
+                    for (var j = 0; j < lines.length; j++)
                     {
                         var found = false;
-                        for (var j = 0; j < headTagElemsByMergeHintArray.length; j++)
+                        for (var k = 0; k < headTagElemsByMergeHintArray.length; k++)
                         {
-                            var existingLine = headTagElemsByMergeHintArray[j].text;
-                            if (existingLine && existingLine.indexOf(lines[i]) >=
0)
+                            var existingLine = headTagElemsByMergeHintArray[k].text;
+                            if (existingLine && existingLine.indexOf(lines[j]) >=
0)
                             {
                                 found = true;
                                 break;
@@ -587,7 +587,7 @@
                         if (!found)
                         {
                             var lastLine = headTagElemsByMergeHintArray[headTagElemsByMergeHintArray.length
- 1].text;
-                            headTagElemsByMergeHintArray[headTagElemsByMergeHintArray.length
- 1].text = (lastLine ? lastLine + "\r\n": "") + lines[i];
+                            headTagElemsByMergeHintArray[headTagElemsByMergeHintArray.length
- 1].text = (lastLine ? lastLine + "\r\n": "") + lines[j];
                         }
                     }
                 }
@@ -595,13 +595,13 @@
                 {
                     var headTagElemsByMergeHintArray = headTagElemsByMergeHint[mergeHint];
                     var lines = childNode.textContent.split(/\n/);
-                    for (var i = 0; i < lines.length; i++)
+                    for (var j = 0; j < lines.length; j++)
                     {
                         var found = false;
-                        for (var j = 0; j < headTagElemsByMergeHintArray.length; j++)
+                        for (var k = 0; k < headTagElemsByMergeHintArray.length; k++)
                         {
-                            var existingLine = headTagElemsByMergeHintArray[j].textContent;
-                            if (existingLine && existingLine.indexOf(lines[i]) >=
0)
+                            var existingLine = headTagElemsByMergeHintArray[k].textContent;
+                            if (existingLine && existingLine.indexOf(lines[j]) >=
0)
                             {
                                 found = true;
                                 break;
@@ -610,7 +610,7 @@
                         if (!found)
                         {
                             var lastLine = headTagElemsByMergeHintArray[headTagElemsByMergeHintArray.length
- 1].textContent;
-                            headTagElemsByMergeHintArray[headTagElemsByMergeHintArray.length
- 1].textContent = (lastLine ? lastLine + "\r\n": "") + lines[i];
+                            headTagElemsByMergeHintArray[headTagElemsByMergeHintArray.length
- 1].textContent = (lastLine ? lastLine + "\r\n": "") + lines[j];
                         }
                     }
                 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message