alshabib

Reverting change to IdBlockGenerator that caused NPE when installing flows.

Change-Id: I86ff72d0cd4560dec2c2a1ce4bf97473d36447bf
......@@ -46,22 +46,20 @@ public class BlockAllocatorBasedIdGenerator implements IdGenerator {
@Override
public long getNewId() {
try {
if (!initialized.get()) {
synchronized (allocator) {
if (!initialized.get()) {
idBlock = allocator.allocateUniqueIdBlock();
initialized.set(true);
}
}
}
return idBlock.getNextId();
} catch (UnavailableIdException e) {
synchronized (allocator) {
idBlock = allocator.allocateUniqueIdBlock();
}
return idBlock.getNextId();
} catch (NullPointerException e) {
synchronized (allocator) {
if (!initialized.get()) {
idBlock = allocator.allocateUniqueIdBlock();
initialized.set(true);
return idBlock.getNextId();
} else {
throw e;
}
}
}
}
}
......