SikuliX1 icon indicating copy to clipboard operation
SikuliX1 copied to clipboard

Region class: waitBest hit IndexOutOfBoundsException

Open thinhdnn opened this issue 1 year ago • 0 comments

My cases:

  1. Bigger image is the first, and the second is the matching image. This will throw an exception.
  2. The first is the matching image, and the second is a bigger image. This will show the first image matched.

Because here. results.add((Integer) current[0], (Long) current[1]); get exception Index of outbound for case 1 Cannot add index 1 to empty list.

for (Future result : fResults) { try { Object[] current = (Object[]) result.get(); maxDuration = Math.max((Long) current[1], maxDuration); results.add((Integer) current[0], (Long) current[1]); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } }

thinhdnn avatar May 28 '23 14:05 thinhdnn