Description
FSNamesystem.internalReleaseLease() uses the result of iFile#numBlocks(); call to get a number of an under construction file's blocks. numBlock() can return 0 if the file doesn't have any blocks yet. This will cause internalReleaseLease() to throw ArrayIndexOutOfBoundException.
In case of a single block file, the same method will throw NullPointerException because the penultimate block is going to be null according to the logic of INodeFile#getPenultimateBlock().