Typo is no ++ in the for loop. The NPE got threw out and appears in stderr, but that's not the easiest way to figure out, so added a log. Updated test case to fail-before-pass-after.
Andrew Wang, I'm really sorry for having this bug from
HDFS-9405. Could you please take a look? Thanks again.