From 3c17ccc39dad7a4d997e78e32d2ad54a98d590e4 Mon Sep 17 00:00:00 2001 From: Vhati Date: Sat, 2 Nov 2013 17:53:36 -0400 Subject: [PATCH] Fixed advanced find tags not honoring start= when greater than match count --- skel_common/readme_changelog.txt | 3 ++- .../java/net/vhati/modmanager/core/XMLPatcher.java | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/skel_common/readme_changelog.txt b/skel_common/readme_changelog.txt index a14b3d9..25e9daa 100644 --- a/skel_common/readme_changelog.txt +++ b/skel_common/readme_changelog.txt @@ -1,7 +1,8 @@ Changelog -???: +1.5: - Added 'no info... yet' message when mods/ scan is still in-progress +- Fixed advanced find tags not honoring start= when greater than match count - Changed FTLDat to allow opening dats in read-only mode 1.4: diff --git a/src/main/java/net/vhati/modmanager/core/XMLPatcher.java b/src/main/java/net/vhati/modmanager/core/XMLPatcher.java index d330c6d..6660478 100644 --- a/src/main/java/net/vhati/modmanager/core/XMLPatcher.java +++ b/src/main/java/net/vhati/modmanager/core/XMLPatcher.java @@ -130,6 +130,9 @@ public class XMLPatcher { matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() ); } } + else { + matchedNodes.clear(); + } if ( panic && matchedNodes.isEmpty() ) throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) ); @@ -182,6 +185,9 @@ public class XMLPatcher { matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() ); } } + else { + matchedNodes.clear(); + } if ( panic && matchedNodes.isEmpty() ) throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) ); @@ -234,6 +240,9 @@ public class XMLPatcher { matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() ); } } + else { + matchedNodes.clear(); + } if ( panic && matchedNodes.isEmpty() ) throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) ); @@ -266,6 +275,9 @@ public class XMLPatcher { matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() ); } } + else { + matchedNodes.clear(); + } if ( panic && matchedNodes.isEmpty() ) throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) );