You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mr...@apache.org on 2011/12/29 07:08:54 UTC
svn commit: r1225445 -
/xalan/java/trunk/src/org/apache/xml/utils/NodeVector.java
Author: mrglavas
Date: Thu Dec 29 06:08:53 2011
New Revision: 1225445
URL: http://svn.apache.org/viewvc?rev=1225445&view=rev
Log:
Fixing an averaging computation that could overflow for large values.
Modified:
xalan/java/trunk/src/org/apache/xml/utils/NodeVector.java
Modified: xalan/java/trunk/src/org/apache/xml/utils/NodeVector.java
URL: http://svn.apache.org/viewvc/xalan/java/trunk/src/org/apache/xml/utils/NodeVector.java?rev=1225445&r1=1225444&r2=1225445&view=diff
==============================================================================
--- xalan/java/trunk/src/org/apache/xml/utils/NodeVector.java (original)
+++ xalan/java/trunk/src/org/apache/xml/utils/NodeVector.java Thu Dec 29 06:08:53 2011
@@ -668,9 +668,10 @@ public class NodeVector implements Seria
/*
* Pick a pivot and move it out of the way
*/
- int pivot = a[(lo + hi) / 2];
+ int mid = (lo + hi) >>> 1;
+ int pivot = a[mid];
- a[(lo + hi) / 2] = a[hi];
+ a[mid] = a[hi];
a[hi] = pivot;
while (lo < hi)
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org