Skip to main content

Java UI : Effects for Controlling UI Object Access

  • Conference paper
ECOOP 2013 – Object-Oriented Programming (ECOOP 2013)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7920))

Included in the following conference series:

Abstract

Most graphical user interface (GUI) libraries forbid accessing UI elements from threads other than the UI event loop thread. Violating this requirement leads to a program crash or an inconsistent UI. Unfortunately, such errors are all too common in GUI programs.

We present a polymorphic type and effect system that prevents non-UI threads from accessing UI objects or invoking UI-thread-only methods. The type system still permits non-UI threads to hold and pass references to UI objects. We implemented this type system for Java and annotated 8 Java programs (over 140KLOC) for the type system, including several of the most popular Eclipse plugins. We confirmed bugs found by unsound prior work, found an additional bug and code smells, and demonstrated that the annotation burden is low.

We also describe code patterns our effect system handles less gracefully or not at all, which we believe offers lessons for those applying other effect systems to existing code.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ingalls, D.H.H.: The Smalltalk-76 Programming System: Design and Implementation. In: POPL (1978)

    Google Scholar 

  2. Zhang, S., Lü, H., Ernst, M.D.: Finding Errors in Multithreaded GUI Applications. In: ISSTA (2012)

    Google Scholar 

  3. Wright, A.K., Felleisen, M.: A Syntactic Approach to Type Soundness. Inf. Comput. 115(1), 38–94 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  4. Gordon, C.S., Dietl, W.M., Ernst, M.D., Grossman, D.: Java UI : Effects for Controlling UI Object Access. Technical Report UW-CSE-13-04-01, University of Washington (2013)

    Google Scholar 

  5. Papi, M.M., Ali, M., Correa Jr., T.L., Perkins, J.H., Ernst, M.D.: Practical Pluggable Types for Java. In: ISSTA (2008)

    Google Scholar 

  6. Dietl, W., Dietzel, S., Ernst, M.D., Muşlu, K., Schiller, T.: Building and Using Pluggable Type-Checkers. In: ICSE (2011)

    Google Scholar 

  7. Foster, J.S., Fähndrich, M., Aiken, A.: A Theory of Type Qualifiers. In: PLDI (1999)

    Google Scholar 

  8. Emir, B., Kennedy, A., Russo, C., Yu, D.: Variance and Generalized Constraints for \(C^{\sharp}\) Generics. In: Thomas, D. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 279–303. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  9. Wheeler, D.A.: SLOCCount, http://www.dwheeler.com/sloccount/

  10. WALA, http://wala.sourceforge.net

  11. Subclipse Issue 889, http://subclipse.tigris.org/issues/show_bug.cgi?id=889

  12. Sutherland, D.F., Scherlis, W.L.: Composable Thread Coloring. In: PPoPP (2010)

    Google Scholar 

  13. Lucassen, J.M., Gifford, D.K.: Polymorphic Effect Systems. In: POPL (1988)

    Google Scholar 

  14. Marino, D., Millstein, T.: A Generic Type-and-Effect System. In: TLDI (2009)

    Google Scholar 

  15. Rytz, L., Odersky, M., Haller, P.: Lightweight Polymorphic Effects. In: Noble, J. (ed.) ECOOP 2012. LNCS, vol. 7313, pp. 258–282. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  16. Bocchino Jr., R.L., Adve, V.S., Dig, D., Adve, S.V., Heumann, S., Komuravelli, R., Overbey, J., Simmons, P., Sung, H., Vakilian, M.: A Type and Effect System for Deterministic Parallel Java. In: OOPSLA (2009)

    Google Scholar 

  17. Kawaguchi, M., Rondon, P., Bakst, A., Jhala, R.: Deterministic Parallelism via Liquid Effects. In: PLDI (2012)

    Google Scholar 

  18. Wadler, P.: The Marriage of Effects and Monads. In: ICFP (1998)

    Google Scholar 

  19. Phooey UI Framework, http://www.haskell.org/haskellwiki/Phooey

  20. Herlihy, M., Luchangco, V., Moir, M., Scherer III, W.N.: Software transactional memory for dynamic-sized data structures. In: PODC (2003)

    Google Scholar 

  21. Harris, T., Marlow, S., Peyton-Jones, S., Herlihy, M.: Composable memory transactions. In: PPoPP (2005)

    Google Scholar 

  22. Blundell, C., Lewis, E., Martin, M.: Subtleties of Transactional Memory Atomicity Semantics. Computer Architecture Letters 5(2) (2006)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Gordon, C.S., Dietl, W., Ernst, M.D., Grossman, D. (2013). Java UI : Effects for Controlling UI Object Access. In: Castagna, G. (eds) ECOOP 2013 – Object-Oriented Programming. ECOOP 2013. Lecture Notes in Computer Science, vol 7920. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-39038-8_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-39038-8_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-39037-1

  • Online ISBN: 978-3-642-39038-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics