skip to main content
10.1145/1985441.1985446acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Java generics adoption: how new features are introduced, championed, or ignored

Published:21 May 2011Publication History

ABSTRACT

Support for generic programming was added to the Java language in 2004, representing perhaps the most significant change to one of the most widely used programming languages today. Researchers and language designers anticipated this addition would relieve many long-standing problems plaguing developers, but surprisingly, no one has yet measured whether generics actually provide such relief. In this paper, we report on the first empirical investigation into how Java generics have been integrated into open source software by automatically mining the history of 20 popular open source Java programs, traversing more than 500 million lines of code in the process. We evaluate five hypotheses, each based on assertions made by prior researchers, about how Java developers use generics. For example, our results suggest that generics do not significantly reduce the number of type casts and that generics are usually adopted by a single champion in a project, rather than all committers.

References

  1. H. Basit, D. Rajapakse, and S. Jarzabek. An empirical study on limits of clone unification using generics. In Proceedings of the International Conference on Software Engineering and Knowledge Engineering, 2005.Google ScholarGoogle Scholar
  2. Y. Benjamini and Y. Hochberg. Controlling the False Discovery Rate: A Practical and Powerful Approach to Multiple Testing. Journal of the Royal Statistical Society. Series B (Methodological), 57(1):289--300, 1995.Google ScholarGoogle ScholarCross RefCross Ref
  3. J. Bloch. Effective Java. Prentice-Hall, 2008.Google ScholarGoogle Scholar
  4. G. Bracha. Lesson: Generics. Web. http://download.oracle.com/javase/tutorial/ extra/generics/index.html.Google ScholarGoogle Scholar
  5. G. Bracha. Generics in the java programming language. Web, July 2005. http://java.sun.com/j2se/1.5/pdf/genericstutorial. pdf.Google ScholarGoogle Scholar
  6. A. Donovan, A. Kiezun, M. S. Tschantz, and M. D. Ernst. Converting java programs to use generic libraries. In OOPSLA '04: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. Dowdy, S. Wearden, and D. Chilko. Statistics for research. John Wiley & Sons, third edition, 2004.Google ScholarGoogle Scholar
  8. N. Ducheneaut. Socialization in an Open Source Software Community: A Socio-Technical Analysis. Computer Supported Cooperative Work, 14(4), 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. Fuhrer, F. Tip, A. Kiezun, J. Dolby, and M. Keller. Efficiently refactoring Java applications to use generic libraries. Eurpoean Conference on Object Oriented Programming, pages 71--96, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. R. Geiger, B. Fluri, H. Gall, and M. Pinzger. Relation of code clones and change couplings. Fundamental Approaches to Software Engineering, 3922:411--425, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. W. S. Humphreys. A Discipline for Software Engineering. Addison-Wesley Publishing, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. Intersimone. New additions to the Java language. Java One 2001 Keynote delivered by James Gosling. Web. http://edn.embarcadero.com/article/27440.Google ScholarGoogle Scholar
  13. S. Markstrum. Staking claims: A history of programming language design claims and evidence. In Proceedings of the Workshop on the Evaluation and Usability of Programming Languages and Tools, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. Mockus, R. Fielding, and J. Herbsleb. Two case studies of open source software development: Apache and Mozilla. ACM Transactions on Software Engineering and Methodology, 11(3):309--346, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. A. Monden, D. Nakae, T. Kamiya, S. Sato, and K. Matsumoto. Software Quality Analysis by Code Clones in Industrial Legacy Software. In Proceedings of the 8th International Symposium on Software Metrics, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Naftalin and P. Wadler. Java generics and collections. O'Reilly Media, Inc., 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. O'Mahony and F. Ferraro. The emergence of governance in an open source community. Academy of Management Journal, 50(5):1079--1106, 2007.Google ScholarGoogle ScholarCross RefCross Ref
  18. V. Pankratius, A. Adl-Tabatabai, and F. Otto. Does Transactional Memory Keep Its Promises?: Results from an Empirical Study. Technical Report 2009--12, Universität Karlsruhe, Fakultät für Informatik, 2009.Google ScholarGoogle Scholar
  19. D. Vandevoorde and N. Josuttis. C++ templates: the Complete Guide. Addison-Wesley Professional, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. T. Zimmermann. Fine-grained Processing of CVS Archives with APFEL. In Proceedings of the OOPSLA Workshop on Eclipse Technology eXchange. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Java generics adoption: how new features are introduced, championed, or ignored

        Recommendations

        Reviews

        Andrew Brooks

        Support for generics in Java was introduced in 2004. Until now, the impact of this introduction has been little studied. This paper presents results from an automatic analysis of the use of generics in the full version histories of the top 20 open-source projects at ohloh.net. Figure 1 reveals considerable variation in the proportions of raw and parameterized types. Five projects made no use of generics. One project, FindBugs, made almost no use of raw types. Do generics reduce casts__?__ Figure 2 reveals small dips in the number of casts when the number of parameterized types increases, but only six projects exhibited such dips. Other software development practices must be responsible for the general decline in the number of casts shown in figure 2. The authors describe as dubious the argument that generics reduce casts. Is old code converted to use generics__?__ Figure 3(a) shows a strong pattern of conversion for SQuirrel SQL. Over 40 percent of raw types were converted over a five-month period. Only three projects, however, had a conversion rate over 12 percent. The authors conclude that most projects do not show large-scale conversions and that introducing new language features does not by itself guarantee their adoption. Though this study did not use questionnaires and interviews to determine reasons for the trends found, it nevertheless provides remarkable insights. As such, I strongly recommended it to Java developers and instructors, and those engaged in language design. Online Computing Reviews Service

        Access critical reviews of Computing literature here

        Become a reviewer for Computing Reviews.

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          MSR '11: Proceedings of the 8th Working Conference on Mining Software Repositories
          May 2011
          260 pages
          ISBN:9781450305747
          DOI:10.1145/1985441

          Copyright © 2011 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 21 May 2011

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Upcoming Conference

          ICSE 2025

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader