← Back to team overview

sikuli-driver team mailing list archive

[Bug 1812578] [NEW] [1.1.4] Region::findWord/findLine throw class cast exception when not found --- should return null as Match --- workaround

 

Public bug reported:

---------------- workaround until fixed
catch the class cast exception, which means not found in this buggy situation.

-------------------------------------------------------------------

1.1.4-SNAPSHOT-2019-01-16_07:30/Windows10.0/Java8(64)1.8.0_191-b12

I used this code:

r = Region(530,348,83,50)
r.findWord("f1")

and I got this error:

[error] script [ Untitled ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last): File "C:\Users\Test\AppData\Local\Temp\Sikulix_967257492\sikuli-6407310615782564146.py", line 2, in <module> r.findWord("f1") at org.sikuli.script.Region.findWord(Region.java:2758)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
java.lang.ClassCastException: java.lang.ClassCastException: org.sikuli.script.Finder cannot be cast to org.sikuli.script.Match

** Affects: sikuli
     Importance: Undecided
         Status: New

** Summary changed:

- [1.1.4] Region::findWord/findLine throw class cast exception when not found --- should return null as Match
+ [1.1.4] Region::findWord/findLine throw class cast exception when not found --- should return null as Match --- workaround

** Description changed:

+ ---------------- workaround until fixed
+ catch the class cast exception, which means not found in this buggy situation.
+ 
+ -------------------------------------------------------------------
+ 
  1.1.4-SNAPSHOT-2019-01-16_07:30/Windows10.0/Java8(64)1.8.0_191-b12
  
  I used this code:
  
  r = Region(530,348,83,50)
  r.findWord("f1")
  
  and I got this error:
  
- 
  [error] script [ Untitled ] stopped with error at line --unknown--
  [error] Error caused by: Traceback (most recent call last): File "C:\Users\Test\AppData\Local\Temp\Sikulix_967257492\sikuli-6407310615782564146.py", line 2, in <module> r.findWord("f1") at org.sikuli.script.Region.findWord(Region.java:2758)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  java.lang.ClassCastException: java.lang.ClassCastException: org.sikuli.script.Finder cannot be cast to org.sikuli.script.Match

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1812578

Title:
  [1.1.4] Region::findWord/findLine throw class cast exception when not
  found --- should return null as Match --- workaround

Status in Sikuli:
  New

Bug description:
  ---------------- workaround until fixed
  catch the class cast exception, which means not found in this buggy situation.

  -------------------------------------------------------------------

  1.1.4-SNAPSHOT-2019-01-16_07:30/Windows10.0/Java8(64)1.8.0_191-b12

  I used this code:

  r = Region(530,348,83,50)
  r.findWord("f1")

  and I got this error:

  [error] script [ Untitled ] stopped with error at line --unknown--
  [error] Error caused by: Traceback (most recent call last): File "C:\Users\Test\AppData\Local\Temp\Sikulix_967257492\sikuli-6407310615782564146.py", line 2, in <module> r.findWord("f1") at org.sikuli.script.Region.findWord(Region.java:2758)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  java.lang.ClassCastException: java.lang.ClassCastException: org.sikuli.script.Finder cannot be cast to org.sikuli.script.Match

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1812578/+subscriptions


Follow ups