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).
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
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)
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)
Drossopoulou, S., Eisenbach, S., Khurshid, S.: Is the java type system sound? Theory and Practice of Object Systems 5(1), 3–24 (1999)
Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: Proceedings of POPL 1998, pp. 171–183. ACM Press, New York (1998)
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)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)
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)
Hoare, C.A.R., He, J.: Unifying Theories of Programming. Prentice-Hall, Englewood Cliffs (1998)
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)
Nipkow, T., von Oheimb, D.: Java light is type-safe-definitely. In: Proceedings of POPL 1998, pp. 161–170. ACM Press, New York (1998)
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
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)