1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-17 22:15:23 +02:00

[380158] [dstore] DataStore.command() fails when multiple commands issue simultaneously

This commit is contained in:
David McKnight 2012-05-22 14:06:53 +00:00
parent 5f7d9fc226
commit b1b36a1b3c

View file

@ -14,6 +14,7 @@
* Contributors: * Contributors:
* David McKnight (IBM) - [226561] [apidoc] Add API markup to RSE Javadocs where extend / implement is allowed * David McKnight (IBM) - [226561] [apidoc] Add API markup to RSE Javadocs where extend / implement is allowed
* David McKnight (IBM) - [373507] [dstore][multithread] reduce heap memory on disconnect for server * David McKnight (IBM) - [373507] [dstore][multithread] reduce heap memory on disconnect for server
* David McKnight (IBM) - [380158] [dstore] DataStore.command() fails when multiple commands issue simultaneously
*******************************************************************************/ *******************************************************************************/
package org.eclipse.dstore.core.model; package org.eclipse.dstore.core.model;
@ -588,20 +589,19 @@ public final class DataElement implements IDataElement
*/ */
public DataElement get(int index) public DataElement get(int index)
{ {
if (_nestedData == null) if (_nestedData == null){
{
return null; return null;
} }
else else
{ {
if (getNestedSize() > index) synchronized(_nestedData){ // bug 380158, sync needed to properly do concurrent commands
{ if (_nestedData.size() > index){
Object obj = _nestedData.get(index); Object obj = _nestedData.get(index);
return (DataElement) obj; return (DataElement) obj;
} }
else else {
{ return null;
return null; }
} }
} }
} }