// ...(略)
// Unsafe publication
public Holder holder;
public void initialize() {
holder = new Holder(42);
}
public 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.");
}
}
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.
評論