1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 12:35:22 +02:00

[282634] [dstore] IndexOutOfBoundsException on Disconnect

This commit is contained in:
David McKnight 2009-07-13 13:35:15 +00:00
parent b20ea620b0
commit 1ad19aa557

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2008 IBM Corporation and others. * Copyright (c) 2002, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -26,6 +26,7 @@
* David McKnight (IBM) - [231639] [dstore] in single-process multi-client mode tracing shouldn't start until the client is set * David McKnight (IBM) - [231639] [dstore] in single-process multi-client mode tracing shouldn't start until the client is set
* Noriaki Takatsu (IBM) - [239073] [dstore] [multithread] In multithread, the cache jar should be assigned after the client is set * Noriaki Takatsu (IBM) - [239073] [dstore] [multithread] In multithread, the cache jar should be assigned after the client is set
* Noriaki Takatsu (IBM) - [245069] [dstore] dstoreTrace has no timestamp * Noriaki Takatsu (IBM) - [245069] [dstore] dstoreTrace has no timestamp
* David McKnight (IBM) - [282634] [dstore] IndexOutOfBoundsException on Disconnect
*******************************************************************************/ *******************************************************************************/
package org.eclipse.dstore.core.model; package org.eclipse.dstore.core.model;
@ -2154,11 +2155,13 @@ public final class DataStore
} }
// notify that preferences have changed // notify that preferences have changed
synchronized (_dataStorePreferenceListeners){
for (int i = 0; i < _dataStorePreferenceListeners.size(); i++){ for (int i = 0; i < _dataStorePreferenceListeners.size(); i++){
IDataStorePreferenceListener listener = (IDataStorePreferenceListener)_dataStorePreferenceListeners.get(i); IDataStorePreferenceListener listener = (IDataStorePreferenceListener)_dataStorePreferenceListeners.get(i);
listener.preferenceChanged(property, value); listener.preferenceChanged(property, value);
} }
} }
}
public String getPreference(String property) public String getPreference(String property)
{ {
@ -2172,8 +2175,10 @@ public final class DataStore
* @since 3.0 * @since 3.0
*/ */
public void addDataStorePreferenceListener(IDataStorePreferenceListener listener){ public void addDataStorePreferenceListener(IDataStorePreferenceListener listener){
synchronized (_dataStorePreferenceListeners){
_dataStorePreferenceListeners.add(listener); _dataStorePreferenceListeners.add(listener);
} }
}
/** /**
* Removes a specific preference change listener from the Datastore * Removes a specific preference change listener from the Datastore
@ -2182,16 +2187,20 @@ public final class DataStore
* @since 3.0 * @since 3.0
*/ */
public void removeDataStorePreferenceListener(IDataStorePreferenceListener listener){ public void removeDataStorePreferenceListener(IDataStorePreferenceListener listener){
synchronized (_dataStorePreferenceListeners){
_dataStorePreferenceListeners.remove(listener); _dataStorePreferenceListeners.remove(listener);
} }
}
/** /**
* Removes all the preference change listeners * Removes all the preference change listeners
* @since 3.0 * @since 3.0
*/ */
public void removeAllDataStorePreferenceListeners(){ public void removeAllDataStorePreferenceListeners(){
synchronized (_dataStorePreferenceListeners){
_dataStorePreferenceListeners.clear(); _dataStorePreferenceListeners.clear();
} }
}
/** /**
* Used to load and initialize a new miner on the host * Used to load and initialize a new miner on the host