You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by nn...@apache.org on 2016/06/30 22:07:48 UTC

incubator-geode git commit: GEODE-1599: Array size allocation method was changed to prevent race condition in CopyOnWriteArray

Repository: incubator-geode
Updated Branches:
  refs/heads/develop 186a09a74 -> ec5578a22


GEODE-1599: Array size allocation method was changed to prevent race condition in CopyOnWriteArray

	* toArray(new Statistics[statlist.size()]); was converted to toArray(new Statistics[0]);
	* This is done to avoid a race condition.
	* The size of the CopyOnWriteArray may increase after allocating the size for the array in which the CopyOnWriteArray is to be placed


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/ec5578a2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/ec5578a2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/ec5578a2

Branch: refs/heads/develop
Commit: ec5578a22c75dbdf7ae698b805307915fcf763a0
Parents: 186a09a
Author: nabarun <nn...@pivotal.io>
Authored: Mon Jun 27 11:12:51 2016 -0700
Committer: nabarun <nn...@pivotal.io>
Committed: Thu Jun 30 15:07:29 2016 -0700

----------------------------------------------------------------------
 .../gemfire/distributed/internal/InternalDistributedSystem.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ec5578a2/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
index a672127..14a4d53 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
@@ -1720,7 +1720,7 @@ public class InternalDistributedSystem
   @Override
   public final Statistics[] getStatistics() {
     List<Statistics> statsList = this.statsList;
-    return (Statistics[])statsList.toArray(new Statistics[statsList.size()]);
+    return (Statistics[])statsList.toArray(new Statistics[0]);
   }
   
   // StatisticsFactory methods