[1.1.0] Try to open shared image in PatternWindow will cause a NullPointerException

Bug #1402056 reported by Voodoo on 2014-12-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sikuli
High
RaiMan

Bug Description

Using SikuliX 1.0.1 or lastest SikuliX 2014 1.1.0 nightly build 2014-12-09 on Windows 8.1 x64 with Java 1.7.0_72.

If you have a test which imports another tests and uses its images (I call them shared images),
first of all it won't show a preview of the shared images until the test was run in the IDE.
After the test was executed you can preview the shared images by toggling with Ctrl + T (two times).
Now if you click on a shared image to view it in the Pattern Window it will cause an NullPointerException
and the Pattern Window won't open.

Here is the trace back:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.sikuli.ide.EditorPatternButton.createThumbnailImage(EditorPatternButton.java:253)
at org.sikuli.ide.EditorPatternButton.setFilename(EditorPatternButton.java:224)
at org.sikuli.ide.EditorPatternButton.getFilename(EditorPatternButton.java:217)
at org.sikuli.ide.PatternPaneNaming.init(PatternPaneNaming.java:46)
at org.sikuli.ide.PatternPaneNaming.<init>(PatternPaneNaming.java:38)
at org.sikuli.ide.PatternWindow.init(PatternWindow.java:74)
at org.sikuli.ide.PatternWindow.<init>(PatternWindow.java:54)
at org.sikuli.ide.EditorPatternButton.actionPerformed(EditorPatternButton.java:153)
at org.sikuli.ide.EditorPatternLabel.mouseClicked(EditorPatternLabel.java:327)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventI

RaiMan (raimund-hocke) wrote :

Again I cannot reproduce on OS X 1.1.0 with latest nightly 1.1.0 (1.0.1 might have these problems).

# main
import testImportSub
find("icon.png").highlight(2) # no thumbnail ever

# testImportSub
from sikuli import *
"icon.png" # thumbnail is shown from beginning and opens Preview

... sure you are really using the latest sikulix.jar from nightly 1.1.0?

RaiMan (raimund-hocke) wrote :

of course:
OS X 10.10.1

Changed in sikuli:
status: New → Opinion
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
Voodoo (voodoo-master-6666) wrote :

I did a fresh install yesterday, see setup log:

[debug (12.12.14 20:49:51)] Debug: setLogFile: H:\Temp\SikuliX-1.1\SikuliX-1.1.0-SetupLog.txt
[debug (12.12.14 20:49:51)] RunSetup: ... starting with no args given
[debug (12.12.14 20:49:51)] RunSetup: Setup in: H:\Temp\SikuliX-1.1
using: H:\Temp\SikuliX-1.1\sikulixsetup-1.1.0.jar
[debug (12.12.14 20:49:51)] RunSetup: SikuliX Setup Build: 1.1.0 2014-12-12_01:01nightly
[debug (12.12.14 20:49:51)] RunSetup: RunningSystem: Windows 6.3
[debug (12.12.14 20:49:51)] RunSetup: parent of jar/classes: H:\Temp\SikuliX-1.1
[debug (12.12.14 20:49:51)] RunSetup: RunningJava: Java 7 (amd64) 1.7.0_72-b14

And here my test scripts:
# main.sikuli
import sys, os
sharedPath = os.path.abspath(os.path.join(getBundlePath(), ".."))
sys.path.insert(0, sharedPath)
import shared
reload(shared)
from shared import *
wait(Pattern("shared_image.png").exact()) # shows up after run and toggle twice with Ctrl + T

# shared.sikuli
from sikuli import *
"shared_image.png"

I have opened only the main script, if this matters.

RaiMan (raimund-hocke) wrote :

ok, thanks and understood.

On Monday I can test on Windows.
... might be Windows special.

Changed in sikuli:
status: Opinion → In Progress
Voodoo (voodoo-master-6666) wrote :

Did you found time to reproduce the bug?

In the meantime I found a workaround, see attached patch.

RaiMan (raimund-hocke) wrote :

ok, thanks for the hint.

This means it is Windows special. I will check and fix.

summary: - [1.0.1] Try to open shared image in PatternWindow will cause a
+ [1.1.0] Try to open shared image in PatternWindow will cause a
NullPointerException
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers