The thing is String.length() doesn't do any re-computation. All it does is return a variable defined in the String object that is modified when the string it contains changes.
See my other comment saying you should ignore any speed suggestions by the article.
That is correct from the String source I am seeing. It simply returns a field, so the JVM probably inlines it into the for loop conditional making this advice not really necessary.
See my other comment saying you should ignore any speed suggestions by the article.