Glacier is a type annotation extension to Java that enforces transitive class immutability.

Glacier helps keep your immutable data immutable.

What does Glacier do?

Transitive: if a class is immutable, then every field must be immutable. This means that all reachable state from an immutable object’s fields is immutable

Class: the immutability of an object depends only on its class’s immutability declaration.

Immutability: state in an object is not changable through any reference to the object.

Is Glacier ready to use?

Glacier works, but it has very limited knowledge of which JDK classes are immutable. You can help! Check out the source code, edit src/edu/cmu/cs/glacier/jdk.astub with annotations for the classes you care about, and submit a pull request.