Merge JavaDoc modification and refactor.
diff --git a/src/main/java/net/onrc/onos/registry/controller/StandaloneRegistry.java b/src/main/java/net/onrc/onos/registry/controller/StandaloneRegistry.java
index 7e82bf0..640a49d 100644
--- a/src/main/java/net/onrc/onos/registry/controller/StandaloneRegistry.java
+++ b/src/main/java/net/onrc/onos/registry/controller/StandaloneRegistry.java
@@ -118,12 +118,17 @@
private long blockTop = 0L;
private static final long BLOCK_SIZE = 0x1000000L;
+
+ /**
+ * Returns a block of IDs which are unique and unused.
+ * Range of IDs is fixed size and is assigned incrementally as this method called.
+ */
@Override
- public IdBlock allocateUniqueIdBlock(){
+ public synchronized IdBlock allocateUniqueIdBlock(){
long blockHead = blockTop;
long blockTail = blockTop + BLOCK_SIZE;
- IdBlock block = new IdBlock(blockHead, blockTail, BLOCK_SIZE);
+ IdBlock block = new IdBlock(blockHead, blockTail - 1, BLOCK_SIZE);
blockTop = blockTail;
return block;