Encapsulating objects with confined types

  • Authors:
  • Christian Grothoff;Jens Palsberg;Jan Vitek

  • Affiliations:
  • University of California, Los Angeles, CA;University of California, Los Angeles, CA;Purdue University, West Lafayette, IN

  • Venue:
  • ACM Transactions on Programming Languages and Systems (TOPLAS)
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

Object-oriented languages provide little support for encapsulating objects. Reference semantics allows objects to escape their defining scope, and the pervasive aliasing that ensues remains a major source of software defects. This paper presents Kacheck/J, a tool for inferring object encapsulation properties of large Java programs. Our goal is to develop practical tools to assist software engineers, thus we focus on simple and scalable techniques. Kacheck/J is able to infer confinement—the property that all instances of a given type are encapsulated in their defining package. This simple property can be used to identify accidental leaks of sensitive objects, as well as for compiler optimizations. We report on the analysis of a large body of code and discuss language support and refactoring for confinement.