From aa1f2c10344c100cfcc015575daf051c4e1fba77 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Thu, 9 Nov 2006 16:25:05 +0000 Subject: [PATCH] null attributes need to be allowed (in particular for delete() case). --- .../dstore/core/model/DataElement.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/model/DataElement.java b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/model/DataElement.java index 8fbcd9f57b7..e326a733c1a 100644 --- a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/model/DataElement.java +++ b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/model/DataElement.java @@ -757,24 +757,24 @@ public final class DataElement implements IDataElement */ public void setAttribute(int attributeIndex, String attribute) { - if (attribute != null) + if ((attributeIndex == DE.A_NAME) && (getAttribute(DE.A_NAME).equals(getAttribute(DE.A_VALUE)))) { - if ((attributeIndex == DE.A_NAME) && (getAttribute(DE.A_NAME).equals(getAttribute(DE.A_VALUE)))) - { - _attributes[DE.A_VALUE] = attribute; - } - else if (attributeIndex == DE.A_DEPTH) - { - _depth = Integer.parseInt(attribute); - } - else if (attributeIndex == DE.A_TYPE) - { - _descriptor = null; - } - - _attributes[attributeIndex] = attribute; - _isUpdated = false; + _attributes[DE.A_VALUE] = attribute; } + else if (attributeIndex == DE.A_DEPTH) + { + if (attribute != null) + _depth = Integer.parseInt(attribute); + else + _depth = 0; + } + else if (attributeIndex == DE.A_TYPE) + { + _descriptor = null; + } + + _attributes[attributeIndex] = attribute; + _isUpdated = false; } /**