You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by re...@apache.org on 2001/02/14 08:40:45 UTC
cvs commit: jakarta-slide/src/share/org/apache/slide/structure ObjectNode.java StructureImpl.java
remm 01/02/13 23:40:45
Modified: src/share/org/apache/slide/structure ObjectNode.java
StructureImpl.java
Log:
- Check if a node already has a child before adding it. Fixes a bug where
children were duplicated when trying to add a node which already existed.
- Fixes typos in a comment in StructureImpl.
- Patch submitted by Michael Smith <ms...@xn.com.au>.
Revision Changes Path
1.5 +6 -8 jakarta-slide/src/share/org/apache/slide/structure/ObjectNode.java
Index: ObjectNode.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/ObjectNode.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ObjectNode.java 2000/12/01 07:17:38 1.4
+++ ObjectNode.java 2001/02/14 07:40:44 1.5
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/ObjectNode.java,v 1.4 2000/12/01 07:17:38 remm Exp $
- * $Revision: 1.4 $
- * $Date: 2000/12/01 07:17:38 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/ObjectNode.java,v 1.5 2001/02/14 07:40:44 remm Exp $
+ * $Revision: 1.5 $
+ * $Date: 2001/02/14 07:40:44 $
*
* ====================================================================
*
@@ -76,7 +76,7 @@
* This includes actors, activities and collections.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public abstract class ObjectNode
implements Serializable, Cloneable {
@@ -181,9 +181,7 @@
* @param object Child
*/
void addChild(ObjectNode child) {
- if ((child != null)) {
- children.addElement(child.getUri());
- }
+ addChild(child.getUri());
}
@@ -193,7 +191,7 @@
* @param uri Child's uri
*/
void addChild(String uri) {
- if (uri != null) {
+ if ((uri != null) && (!hasChild(uri))) {
// We put a dummy object in the hashtable
children.addElement(uri);
}
1.14 +5 -5 jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java
Index: StructureImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- StructureImpl.java 2001/02/09 03:29:35 1.13
+++ StructureImpl.java 2001/02/14 07:40:45 1.14
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v 1.13 2001/02/09 03:29:35 remm Exp $
- * $Revision: 1.13 $
- * $Date: 2001/02/09 03:29:35 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v 1.14 2001/02/14 07:40:45 remm Exp $
+ * $Revision: 1.14 $
+ * $Date: 2001/02/14 07:40:45 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
* Data helper class.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.13 $
+ * @version $Revision: 1.14 $
*/
public final class StructureImpl implements Structure {
@@ -535,7 +535,7 @@
if (alreadyExists) {
// if the object already exists map it anyway into
- // the node hirachy, to prevent loose of nodes
+ // the node hierarchy, to prevent loose of nodes
// during start up
parentObject.addChild(courObject);
store(token, parentObject);