1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-31 04:45:38 +02:00

spirit fix found in RSE 713 applied to open source

This commit is contained in:
David McKnight 2007-04-17 20:21:22 +00:00
parent 8a71bd42ac
commit 9bc33d000e

View file

@ -530,19 +530,21 @@ public class XMLparser
if (parent != null && parent.getNestedSize() > 0 && _dataStore.isVirtual())
{
// end of children of parent
// find all spirits that match non-spirits
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())
{
boolean addedToDelete = false;
String name = element.getName();
String value = element.getValue();
// 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)
{
@ -550,7 +552,10 @@ public class XMLparser
String cname = compare.getName();
String cvalue = compare.getValue();
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);
}
}
}
_tagStack.pop();
if (_tagStack.empty())