At line 173 in Vectorize20NewsGroups.java [1], the substring call is from startIndex 1 to endIndex 1 which always returns an empty string.
So, the CorpusWeighting cw is always going to be null.
Did you run it to see if it works? :)
[1] c09d742#L0R173