Menu

#85 query.trim() doesn't modify the String Object in KeywordSearchTupleSet.java

v1.0 (example)
open
nobody
None
5
2016-05-31
2016-05-31
No

Return value of String.trim() ignored in prefuse.data.search.KeywordSearchTupleSet.search(String)
The return value of this method should be checked. The cause of this bug is to invoke a method on an immutable object, thinking that it updates the object.
But since Strings are immutable, the trim() function returns a new String value, which is being ignored here. The code should be corrected to: query = query.trim();

Discussion


Log in to post a comment.