hazelcast/hazelcast-code-samples — pull request #22 by karlroberts (2014-10-14 01:55:08+00:00)
Title: Fix/3.x/21

Fixes issue #21

The bug was that before locking the code set an Empty Value... so when you run the main twice to test it the second JVM writes an empty value into the map that has already been modified by the first JVM.

I added a setup method to check to check if it should add the empty Value (ie if it is the first JVM and the value is null) in a locked portion of code. This fixes the demo.

I also shutdown the hz Instance after the test. it is annoying that running the demo leaves instances running which may conflict with other demo's you want to run.