Github user ohshazbot commented on a diff in the pull request:
https://github.com/apache/curator/pull/48#discussion_r19763228
--- Diff:
curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessReadWriteLock.java
---
@@ -261,6 +261,39 @@ public Void call() throws Exception
Assert.assertTrue(maxConcurrentCount.get() > 1);
}
+ @Test
+ public void testSetNodeData() throws Exception
+ {
+ CuratorFramework client =
CuratorFrameworkFactory.newClient(server.getConnectString(), new
RetryOneTime(1));
+
+ try
+ {
+ client.start();
+
+ final byte[] nodeData = new byte[] { 1, 2, 3, 4 };
+
+ InterProcessReadWriteLock lock = new
InterProcessReadWriteLock(client, "/lock", nodeData);
+
+ // mutate passed-in node data, lock has made copy
+ nodeData[0] = 5;
--- End diff --
Looks like it's to ensure that the passed in data is being copied, so any
alterations to the byte array after the fact don't cause some sort of partial
view of data.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---