jhy/jsoup — pull request #478 by hannibal218bc (2014-10-18 15:32:57+00:00)
Title: Element.classNames() must not be cached

Element.classNames() previously prepared the class name set just once and cached it. Hence, the returned set does not reflect later changes to the "class" attribute, neither through attr("class", "newclass") nor through classNames(newSet).

Since the caching behaviour is not documented, I believe the correct result would be to always return the latest class name set. This change removes the cached map and always prepares the class name set from scratch. Applications calling classNames() often may hit a performance penalty.