A kind of potential NullPointerException bugs in method tokenizeToStringArray #468
Description
Hi all,
Our tool has found one kind of potential NPE bugs caused by returning null in method tokenizeToStringArray.
There are several points that use the null
value, including:
-
assigned to variable
pathParts
in method extractPathWithinPattern and used it bypathParts.length
in method extractPathWithinPattern -
assigned to variable
patternParts
in method extractPathWithinPattern and used it bypathParts.length
in method extractPathWithinPattern -
the
null
value is returned by method tokenizePath. There are still several points that use thisnull
value, including:
3.1. assigned to variablepathDirs
in method doMatch and used it bypathDirs.length - 1
in method doMatch
3.2. assigned to variabletokenized
in method tokenizePattern and assigned to variablepattDirs
byString[] pattDirs = tokenizePattern(pattern);
in method doMatch. Finally, it is used bypattDirs.length - 1;
Thanks.