Lines 98-110
Link Here
|
98 |
*/ |
98 |
*/ |
99 |
public synchronized void addElementChangedListener(IElementChangedListener listener, int eventMask) { |
99 |
public synchronized void addElementChangedListener(IElementChangedListener listener, int eventMask) { |
100 |
for (int i = 0; i < this.elementChangedListenerCount; i++){ |
100 |
for (int i = 0; i < this.elementChangedListenerCount; i++){ |
101 |
if (this.elementChangedListeners[i].equals(listener)){ |
101 |
if (this.elementChangedListeners[i] == listener){ |
102 |
|
102 |
|
103 |
// only clone the masks, since we could be in the middle of notifications and one listener decide to change |
103 |
// only clone the masks, since we could be in the middle of notifications and one listener decide to change |
104 |
// any event mask of another listeners (yet not notified). |
104 |
// any event mask of another listeners (yet not notified). |
105 |
int cloneLength = this.elementChangedListenerMasks.length; |
105 |
int cloneLength = this.elementChangedListenerMasks.length; |
106 |
System.arraycopy(this.elementChangedListenerMasks, 0, this.elementChangedListenerMasks = new int[cloneLength], 0, cloneLength); |
106 |
System.arraycopy(this.elementChangedListenerMasks, 0, this.elementChangedListenerMasks = new int[cloneLength], 0, cloneLength); |
107 |
this.elementChangedListenerMasks[i] = eventMask; // could be different |
107 |
this.elementChangedListenerMasks[i] |= eventMask; // could be different |
108 |
return; |
108 |
return; |
109 |
} |
109 |
} |
110 |
} |
110 |
} |
Lines 119-127
Link Here
|
119 |
this.elementChangedListenerCount++; |
119 |
this.elementChangedListenerCount++; |
120 |
} |
120 |
} |
121 |
|
121 |
|
122 |
public void addPreResourceChangedListener(IResourceChangeListener listener, int eventMask) { |
122 |
public synchronized void addPreResourceChangedListener(IResourceChangeListener listener, int eventMask) { |
123 |
for (int i = 0; i < this.preResourceChangeListenerCount; i++){ |
123 |
for (int i = 0; i < this.preResourceChangeListenerCount; i++){ |
124 |
if (this.preResourceChangeListeners[i].equals(listener)) { |
124 |
if (this.preResourceChangeListeners[i] == listener) { |
125 |
this.preResourceChangeEventMasks[i] |= eventMask; |
125 |
this.preResourceChangeEventMasks[i] |= eventMask; |
126 |
return; |
126 |
return; |
127 |
} |
127 |
} |
Lines 295-301
Link Here
|
295 |
|
295 |
|
296 |
for (int i = 0; i < this.elementChangedListenerCount; i++){ |
296 |
for (int i = 0; i < this.elementChangedListenerCount; i++){ |
297 |
|
297 |
|
298 |
if (this.elementChangedListeners[i].equals(listener)){ |
298 |
if (this.elementChangedListeners[i] == listener){ |
299 |
|
299 |
|
300 |
// need to clone defensively since we might be in the middle of listener notifications (#fire) |
300 |
// need to clone defensively since we might be in the middle of listener notifications (#fire) |
301 |
int length = this.elementChangedListeners.length; |
301 |
int length = this.elementChangedListeners.length; |
Lines 321-331
Link Here
|
321 |
} |
321 |
} |
322 |
} |
322 |
} |
323 |
|
323 |
|
324 |
public void removePreResourceChangedListener(IResourceChangeListener listener) { |
324 |
public synchronized void removePreResourceChangedListener(IResourceChangeListener listener) { |
325 |
|
325 |
|
326 |
for (int i = 0; i < this.preResourceChangeListenerCount; i++){ |
326 |
for (int i = 0; i < this.preResourceChangeListenerCount; i++){ |
327 |
|
327 |
|
328 |
if (this.preResourceChangeListeners[i].equals(listener)){ |
328 |
if (this.preResourceChangeListeners[i] == listener){ |
329 |
|
329 |
|
330 |
// need to clone defensively since we might be in the middle of listener notifications (#fire) |
330 |
// need to clone defensively since we might be in the middle of listener notifications (#fire) |
331 |
int length = this.preResourceChangeListeners.length; |
331 |
int length = this.preResourceChangeListeners.length; |