The problem is in the line
PersonId[] personId = new PersonId[lineCount];
PersonId is a class (reference type) so when you create the array, all the elements are initialized to null. You need to create an instance for each array element.
One way to do that would be to insert this line immediately before the line that throws the exception:
personId [y] = new PersonId();