Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-dev] SWT naive question: why "checkWidget()" everywhere?

Hi all,

I'm currently working on the topic of moving work out of UI Thread, using JDT as main target (bug 538656).
In my investigations, I've hit the case of calling `StyledText.getBlockSelection()` sending a InvalidThreadAccess because first line of the method is `checkWidget()`.
However, this method is mostly a boolean accessor, the state of block selection or not is purely inside the Java logic, no JNI. Invoking this method from a thread is definitely a harmless operation
So I'm wondering: why is SWT putting so much `checkWidget()` even on simple accessors? Is this something we could get rid of?

Thanks in advance for your insights.

--
Mickael Istria
Eclipse IDE developer, for Red Hat Developers

Back to the top