Fixed advanced find tags not honoring start= when greater than match count

This commit is contained in:
Vhati 2013-11-02 17:53:36 -04:00
parent 6f3d434046
commit 3c17ccc39d
2 changed files with 14 additions and 1 deletions

View file

@ -1,7 +1,8 @@
Changelog Changelog
???: 1.5:
- Added 'no info... yet' message when mods/ scan is still in-progress - 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 - Changed FTLDat to allow opening dats in read-only mode
1.4: 1.4:

View file

@ -130,6 +130,9 @@ public class XMLPatcher {
matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() ); matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
} }
} }
else {
matchedNodes.clear();
}
if ( panic && matchedNodes.isEmpty() ) if ( panic && matchedNodes.isEmpty() )
throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) ); 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() ); matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
} }
} }
else {
matchedNodes.clear();
}
if ( panic && matchedNodes.isEmpty() ) if ( panic && matchedNodes.isEmpty() )
throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) ); 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() ); matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
} }
} }
else {
matchedNodes.clear();
}
if ( panic && matchedNodes.isEmpty() ) if ( panic && matchedNodes.isEmpty() )
throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) ); 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() ); matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() );
} }
} }
else {
matchedNodes.clear();
}
if ( panic && matchedNodes.isEmpty() ) if ( panic && matchedNodes.isEmpty() )
throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) ); throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) );