mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 21:35:40 +02:00
spirit fix found in RSE 713 applied to open source
This commit is contained in:
parent
8a71bd42ac
commit
9bc33d000e
1 changed files with 29 additions and 23 deletions
|
@ -530,19 +530,21 @@ public class XMLparser
|
||||||
|
|
||||||
if (parent != null && parent.getNestedSize() > 0 && _dataStore.isVirtual())
|
if (parent != null && parent.getNestedSize() > 0 && _dataStore.isVirtual())
|
||||||
{
|
{
|
||||||
// end of children of parent
|
|
||||||
// find all spirits that match non-spirits
|
|
||||||
List toDelete = new ArrayList();
|
List toDelete = new ArrayList();
|
||||||
for (int s= 0; s < parent.getNestedSize(); s++)
|
List nested = parent.getNestedData();
|
||||||
|
synchronized (nested)
|
||||||
{
|
{
|
||||||
DataElement element = parent.get(s);
|
for (int s= 0; s < nested.size(); s++)
|
||||||
|
{
|
||||||
|
DataElement element = (DataElement)nested.get(s);
|
||||||
if (element.isSpirit())
|
if (element.isSpirit())
|
||||||
{
|
{
|
||||||
|
boolean addedToDelete = false;
|
||||||
String name = element.getName();
|
String name = element.getName();
|
||||||
String value = element.getValue();
|
String value = element.getValue();
|
||||||
|
|
||||||
// delete this element if there's another one with the same name and value
|
// delete this element if there's another one with the same name and value
|
||||||
for (int n = 0; n < parent.getNestedSize(); n++)
|
for (int n = 0; n < parent.getNestedSize() && !addedToDelete; n++)
|
||||||
{
|
{
|
||||||
if (n != s)
|
if (n != s)
|
||||||
{
|
{
|
||||||
|
@ -550,7 +552,10 @@ public class XMLparser
|
||||||
String cname = compare.getName();
|
String cname = compare.getName();
|
||||||
String cvalue = compare.getValue();
|
String cvalue = compare.getValue();
|
||||||
if (!compare.isSpirit() && cname.equals(name) && cvalue.equals(value))
|
if (!compare.isSpirit() && cname.equals(name) && cvalue.equals(value))
|
||||||
toDelete.add(compare);
|
{
|
||||||
|
toDelete.add(element);
|
||||||
|
addedToDelete = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -563,6 +568,7 @@ public class XMLparser
|
||||||
_dataStore.deleteObject(parent,delement);
|
_dataStore.deleteObject(parent,delement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_tagStack.pop();
|
_tagStack.pop();
|
||||||
if (_tagStack.empty())
|
if (_tagStack.empty())
|
||||||
|
|
Loading…
Add table
Reference in a new issue