commons-math
commons-math copied to clipboard
The TreeBuilder constructor does not check the validity of the input String s
The TreeBuilder constructor does not check whether the input string s is null before constructing
a StringTokenizer. This will cause a NullPointerException to be thrown according to the docs.
It also does not check whether s is empty. This will cause a NoSuchElementException to be thrown when nextToken() is called according to the docs.
This pull request adds a check to the String s and throws a ParseException if s is null or empty. It also adds two tests.