/** * INTERNAL: * Check whether the contents have been read from the database. * If they have not, read them and set the delegate. * This method used to be synchronized, which caused deadlock. */ protected Hashtable<K, V> getDelegate() { if (delegate == null) { synchronized(this){ if (delegate == null) { delegate = this.buildDelegate(); } } } return delegate; }
/** * INTERNAL: * Check whether the contents have been read from the database. * If they have not, read them and set the delegate. * This method used to be synchronized, which caused deadlock. */ protected Hashtable getDelegate() { if (delegate == null) { synchronized(this){ if (delegate == null) { delegate = this.buildDelegate(); } } } return delegate; }
/** * INTERNAL: * Check whether the contents have been read from the database. * If they have not, read them and set the delegate. * This method used to be synchronized, which caused deadlock. */ protected Hashtable<K, V> getDelegate() { Hashtable<K, V> newDelegate = this.delegate; if (newDelegate == null) { synchronized(this){ newDelegate = this.delegate; if (newDelegate == null) { this.delegate = newDelegate = this.buildDelegate(); } } } return newDelegate; }