JAVA / Sikulix 2.0.4 / findBestList() refuses to accept an ArrayList<Pattern>

Asked by Nir on 2020-05-14

Hello RaiMan,

Working with SikuliX 2.0.4 in Java.

I'm trying to work with findBestList() for the first time and I can't seem to figure out why it refuses to accept an ArrayList<Pattern> as a parameter.
I read the Region documentation and the way I understand it - my list should be accepted.

Below is the method call, 'listOfPatterns' is an ArrayList that I build elsewhere in the code and pass here, it contains several Sikulix 'Pattern' objects:

Match match = region.findBestList(listOfPatterns);

IntelliJ IDEA marks 'listOfPatterns' in red and gives me the following error:

'findBestList(java.util.List<java.lang.Object>)' in 'org.sikuli.script.Region' cannot be applied to '(java.util.List<org.sikuli.script.Pattern>)'

Any pointers on what I'm doing wrong here?

Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2020-05-14
Last reply:
2020-06-13
RaiMan (raimund-hocke) said : #4

has to be checked.

Can you help with this problem?

Provide an answer of your own, or ask Nir for more information if necessary.

To post a message you must log in.