From: <pau...@us...> - 2007-12-03 10:47:49
|
Revision: 5604 http://smartfrog.svn.sourceforge.net/smartfrog/?rev=5604&view=rev Author: paul_murray Date: 2007-12-03 02:34:07 -0800 (Mon, 03 Dec 2007) Log Message: ----------- [SF-572] default for sfDump does not handle references with repeated names correctly Modified Paths: -------------- trunk/core/smartfrog/src/org/smartfrog/sfcore/common/DumperCDImpl.java trunk/core/smartfrog/src/org/smartfrog/sfcore/reference/Reference.java Modified: trunk/core/smartfrog/src/org/smartfrog/sfcore/common/DumperCDImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/sfcore/common/DumperCDImpl.java 2007-11-30 13:12:53 UTC (rev 5603) +++ trunk/core/smartfrog/src/org/smartfrog/sfcore/common/DumperCDImpl.java 2007-12-03 10:34:07 UTC (rev 5604) @@ -122,7 +122,7 @@ String name = ((HereReferencePart)(relativeRef.lastElement())).getValue().toString(); - relativeRef.removeElement(relativeRef.lastElement()); + relativeRef.removeElement(relativeRef.size()-1); //Place stateCopy in the right spot inside cd. try { Modified: trunk/core/smartfrog/src/org/smartfrog/sfcore/reference/Reference.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/sfcore/reference/Reference.java 2007-11-30 13:12:53 UTC (rev 5603) +++ trunk/core/smartfrog/src/org/smartfrog/sfcore/reference/Reference.java 2007-12-03 10:34:07 UTC (rev 5604) @@ -364,7 +364,7 @@ return ret; } - + /** * Returns last element in reference. * @@ -412,7 +412,7 @@ } /** - * Remove element from reference. + * Remove the first element that matches from reference. * * @param o to remove from reference * @@ -423,6 +423,18 @@ } /** + * Removes the reference part at the given index. All + * parts with an index greater then index are shifted one to + * the left (n-1). Returns the reference part removed. + * + * @param index + * @return + */ + public ReferencePart removeElement(int index) { + return (ReferencePart)ref.remove(index); + } + + /** * Resolves this reference using the given reference resolver, and starting * at index of this reference. If the reference size is 0 the given * reference resolver is returned. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |