The SwingLibrary keyword "Get List Values" currently only works if the list items are strings, however in some cases the list items are other objects (which in turn can have strings inside). The getListValues() method in ListOperator.java iterates all list items and tries to cast them to string like so:
items.add((String)model.getElementAt(i));
However this will fail when the list item is a complex object instead of a simple string. But since all objects in Java implement the toString() method, instead of doing a cast, if we call toString() method not only it will not fail, but will be more compatible with lists that have objects which contain strings and implement toString(). So my proposal is to change getListValues() to iterate items like so:
items.add(model.getElementAt(i).toString());
This shouldn't break anything and will increase compatibility with applications that use lists with objects. Application developers can use this opportunity to increase compatibility with Robot for automation on applications that use may customized GUI objects.
PS: since it is such a small change I don't think it deserves a pull request for this. Let me know if you think i'm wrong.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4