public List unwatchAndReturnAllWatched() { ArrayList var1 = null; if (this.objectChanged) { this.field_75694_d.readLock().lock(); Iterator var2 = this.watchedObjects.values().iterator(); while (var2.hasNext()) { WatchableObject var3 = (WatchableObject) var2.next(); if (var3.isWatched()) { var3.setWatched(false); if (var1 == null) { var1 = new ArrayList(); } var1.add(var3); } } this.field_75694_d.readLock().unlock(); } this.objectChanged = false; return var1; }
public List unwatchAndReturnAllWatched() { ArrayList arraylist = null; if (this.objectChanged) { this.lock.readLock().lock(); Iterator iterator = this.watchedObjects.values().iterator(); while (iterator.hasNext()) { WatchableObject watchableobject = (WatchableObject) iterator.next(); if (watchableobject.isWatched()) { watchableobject.setWatched(false); if (arraylist == null) { arraylist = new ArrayList(); } arraylist.add(watchableobject); } } this.lock.readLock().unlock(); } this.objectChanged = false; return arraylist; }