Skip to content

Instantly share code, notes, and snippets.

@draftcode
Created December 25, 2011 11:55
Show Gist options
  • Select an option

  • Save draftcode/1519140 to your computer and use it in GitHub Desktop.

Select an option

Save draftcode/1519140 to your computer and use it in GitHub Desktop.
class Holder {
private int n;
public Holder(int n) { this.n = n; }
public void assertSanity() {
if (n != n) {
throw new AssertionError("This statement is false.");
}
}
}
class UnsafePublic {
public Holder holder;
public void initialize() {
holder = new Holder(42);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment