Adoption and use of Java generics

  • Authors:
  • Chris Parnin;Christian Bird;Emerson Murphy-Hill

  • Affiliations:
  • College of Computing, Georgia Institute of Technology, Atlanta, USA 30332;Microsoft Research, Redmond, USA 98052;Department of Computer Science, North Carolina State University, Raleigh, USA 27695

  • Venue:
  • Empirical Software Engineering
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

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 how generics have been adopted and used in practice. 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 40 popular open source Java programs, traversing more than 650 million lines of code in the process. We evaluate five hypotheses and research questions about how Java developers use generics. For example, our results suggest that generics sometimes reduce the number of type casts and that generics are usually adopted by a single champion in a project, rather than all committers. We also offer insights into why some features may be adopted sooner and others features may be held back.