Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Avoiding "Illegal Thread Access" using annotations

Hi,

Last week at ECOOP [1] I listened to a presentation by Colin Gordon
([2] and Cc:) where he described a system of annotations by which
illegal thread access in SWT can be detected statically.

I discussed this with Colin and also with Simon K. (Cc:) who was in
the audience, too. The bottom line being: we all think it would be
cool to put this research into practice in order to systematically
avoid this kind of bug.

Colin's paper can be downloaded from his web page, look for
"JavaUI: Effects for Controlling UI Object Access".
Also his slides are online.

If we could convince you guys of the benefit, these would be the
next steps:

- For full power of the approach Colin et al use type annotations,
  which require Java 8 (he's working with the JSR 308 co-lead Mike
  Ernst). Colin mentioned that much of this would already be possible
  with J2SE 5 annotations, but a few more thoughts should be spent
  on how to get the most benefit for now, without blocking adoption
  of type annotations once we have them.

- SWT and JFace would add annotations to their API in order to make
  implicit contracts explicit. Colin already has these annotations,
  which might benefit from a review by the experts: These annotations
  are defined in a conservative manner - with more detailed insights
  the annotations could perhaps be less restrictive.

- I would take the issue into JDT/Core, and try to convince the
  leads that it would be a valuable addition to have ECJ to
  (optionally) perform this analysis.

- Clients of SWT can adopt the approach at their own pace, adding
  annotations to their own code, to be checked against the
  annotations in the API.

what do you think?
Stephan

[1] http://2013.ecoop.org
[2] http://homes.cs.washington.edu/~csgordon/


Back to the top