mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
synchronized
This commit is contained in:
parent
5d070662b6
commit
317c2afd3a
1 changed files with 9 additions and 6 deletions
|
@ -351,7 +351,7 @@ public final class DataElement implements IDataElement
|
||||||
* @param nestedData a set of elements to add to this element
|
* @param nestedData a set of elements to add to this element
|
||||||
* @param checkUnique whether to prevent duplicates from being added
|
* @param checkUnique whether to prevent duplicates from being added
|
||||||
*/
|
*/
|
||||||
public void addNestedData(List nestedData, boolean checkUnique)
|
public synchronized void addNestedData(List nestedData, boolean checkUnique)
|
||||||
{
|
{
|
||||||
if (nestedData != null)
|
if (nestedData != null)
|
||||||
{
|
{
|
||||||
|
@ -377,7 +377,7 @@ public final class DataElement implements IDataElement
|
||||||
* @param obj the element to add
|
* @param obj the element to add
|
||||||
* @param checkUnique whether to prevent duplicates from being added
|
* @param checkUnique whether to prevent duplicates from being added
|
||||||
*/
|
*/
|
||||||
public void addNestedData(DataElement obj, boolean checkUnique)
|
public synchronized void addNestedData(DataElement obj, boolean checkUnique)
|
||||||
{
|
{
|
||||||
if (_nestedData == null)
|
if (_nestedData == null)
|
||||||
{
|
{
|
||||||
|
@ -421,7 +421,7 @@ public final class DataElement implements IDataElement
|
||||||
{
|
{
|
||||||
if (_nestedData != null)
|
if (_nestedData != null)
|
||||||
{
|
{
|
||||||
// synchronized(_nestedData)
|
synchronized(_nestedData)
|
||||||
{
|
{
|
||||||
_nestedData.remove(object);
|
_nestedData.remove(object);
|
||||||
}
|
}
|
||||||
|
@ -437,10 +437,13 @@ public final class DataElement implements IDataElement
|
||||||
{
|
{
|
||||||
if (_nestedData != null)
|
if (_nestedData != null)
|
||||||
{
|
{
|
||||||
while (_nestedData.size() > 0)
|
synchronized (_nestedData)
|
||||||
{
|
{
|
||||||
DataElement nestedObject = (DataElement) _nestedData.get(0);
|
while (_nestedData.size() > 0)
|
||||||
_nestedData.remove(nestedObject);
|
{
|
||||||
|
DataElement nestedObject = (DataElement) _nestedData.get(0);
|
||||||
|
_nestedData.remove(nestedObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue