Skip to main content

Type Safety for FJ and FGJ

  • Conference paper
  • 287 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4281))

Abstract

Mainly concerned with type safety, Featherweight Java, or FJ, is a well known minimal core for Java and Generic Java. However, in the type system of FJ, the treatment of downcast is omitted. In this paper we propose a stronger type system for FJ and FGJ. In order to deal with the cast problems, we introduce some special techniques for types, and also strengthen the types for expressions and methods in terms of the type declaration notations. Supported by the type system and our techniques, we can ensure properties stronger than the ones proved in Igarashi et al’s original FJ paper. Examples making the above mentioned contributions clear are illustrated throughout this paper. Furthermore a case study on design patterns showing the advantages of our results is given.

Supported by NNSF of China (No. 605730081).

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

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Agesen, O., Freund, S., Mitchell, J.C.: Adding type parameterization to the java language. In: Proceedings of OOPSLA 1997, pp. 49–65. ACM Press, New York (1997)

    Chapter  Google Scholar 

  2. Bracha, G., Odersky, M., Stoutamire, D., Wadler, P.: Making the future safe for the past: Adding genericity to the JavaTM programming language. In: Proceedings of OOPSLA 1998, pp. 183–200. ACM Press, New York (1998)

    Chapter  Google Scholar 

  3. Drossopoulou, S., Eisenbach, S., Khurshid, S.: Is the java type system sound? Theory and Practice of Object Systems 5(1), 3–24 (1999)

    Article  Google Scholar 

  4. Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: Proceedings of POPL 1998, pp. 171–183. ACM Press, New York (1998)

    Chapter  Google Scholar 

  5. Flatt, M., Krishnamurthi, S., Felleisen, M.: A programmer’s reduction semantics for classes and mixins. Technical Report 97-293, Computer Science Dept., Rice University, Corrected version in (June 1999)

    Google Scholar 

  6. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)

    Google Scholar 

  7. Jifeng, H., Liu, Z., Li, X., Qin, S.C.: A relational model for object-oriented designs. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 415–436. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  8. Hoare, C.A.R., He, J.: Unifying Theories of Programming. Prentice-Hall, Englewood Cliffs (1998)

    Google Scholar 

  9. Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight java: A minimal core calculus for Java and GJ. In: Proceedings of OOPSLA 1999, pp. 132–146. ACM Press, New York (1999)

    Chapter  Google Scholar 

  10. Nipkow, T., von Oheimb, D.: Java light is type-safe-definitely. In: Proceedings of POPL 1998, pp. 161–170. ACM Press, New York (1998)

    Chapter  Google Scholar 

  11. Shuling, W., Long, Q., Zongyan, Q.: Type safety for FJ and FGJ. Technical Report 2005-40, Inst. of Math., Peking Univ. Corrected version in (August 2006), http://www.math.pku.edu.cn:8000/en/preindex.php

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Wang, S., Long, Q., Qiu, Z. (2006). Type Safety for FJ and FGJ. In: Barkaoui, K., Cavalcanti, A., Cerone, A. (eds) Theoretical Aspects of Computing - ICTAC 2006. ICTAC 2006. Lecture Notes in Computer Science, vol 4281. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11921240_18

Download citation

  • DOI: https://doi.org/10.1007/11921240_18

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-48815-6

  • Online ISBN: 978-3-540-48816-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics