Make StringUtil.substring safe from exceptions
Fixed javadoc for java 8