mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 23:55:26 +02:00
[380158] [dstore] DataStore.command() fails when multiple commands issue simultaneously
This commit is contained in:
parent
5f7d9fc226
commit
b1b36a1b3c
1 changed files with 10 additions and 10 deletions
|
@ -14,6 +14,7 @@
|
|||
* Contributors:
|
||||
* 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) - [380158] [dstore] DataStore.command() fails when multiple commands issue simultaneously
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.dstore.core.model;
|
||||
|
@ -588,20 +589,19 @@ public final class DataElement implements IDataElement
|
|||
*/
|
||||
public DataElement get(int index)
|
||||
{
|
||||
if (_nestedData == null)
|
||||
{
|
||||
if (_nestedData == null){
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getNestedSize() > index)
|
||||
{
|
||||
Object obj = _nestedData.get(index);
|
||||
return (DataElement) obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
synchronized(_nestedData){ // bug 380158, sync needed to properly do concurrent commands
|
||||
if (_nestedData.size() > index){
|
||||
Object obj = _nestedData.get(index);
|
||||
return (DataElement) obj;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue