I haven't been following this discussion, so forgive my ignorance/negligence,
but what is the purpose of having the first "if" outside the synchronized block?
Wouldn't it be just enough having one "if" inside the synchro?
Just asking...


BarZ

public abstract class Store {
private static Collection items = null;
private Collection specials = null;
static {
if ( items == null ) {
synchronized( Store.class) {
if ( items == null ) {
items = //get List of Items from somewhere
}
}
}
}
public static Collection getItems() {
return items;
}
public Collection getSpecials() {
return specials;
}
}







--- You are currently subscribed to jdjlist as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] http://www.sys-con.com/fusetalk

Reply via email to