The Java language lacks the important notions of <i>ownership</i> (an object owns its representation to prevent unwanted aliasing) and <i>immutability</i> (the division into mutable, immutable, and readonly data and references). Programmers are prone to design errors, such as representation exposure or violation of immutability contracts. This paper… (More)
Cloning is an essential feature in many object-oriented programs. Unfortunately, existing techniques generally copy too little or too much. We present an object cloning technique that uses the object structure enforced by ownership types to produce the clones.