Skip to main content

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

Just a guess: Please imagine that *currently* it might be simple getter, but later might become a more advanced code. Making it accessible from multiple threads would break the code in the future.

BTW, this method most likely would make no difference in your code whether it performs too much in the EDT or not. If there is a problem, it probably lies somewhere else, e.g. when reading/writing files in the EDT.

Cheers,
Tom


On 2019-05-27 13:58, Mickael Istria wrote:
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.


_______________________________________________
platform-dev mailing list
platform-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/platform-dev



Back to the top