Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Not A Bug
-
2.4.7
-
None
-
None
-
Ubuntu 16.04
Description
For the following script,
def names = [] names << "Anand" names << "Aditya" names << "Abhi" def searchItem = "bug" if (names.find() == searchItem) println "item found " else println "Item not found " println "adding the Item" names << searchItem println "Item added" println "values: $names" println "trying again" if (names.find() == searchItem) println "Item found " else println "Item still not found "
In list there first the search item is not present and it has yielded false but then i added the item and still find method is giving false. The opposite case work well i.e if initially item is there it gives true and then if i remove it then it gives false.
Is it how it is designed to work or is this a bug.