Skip to content

Commit bcea6c3

Browse files
committed
[bugfix] Make sure to set matches correctly when there is a Wildcard Test in a predicate
1 parent 47c53dd commit bcea6c3

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

exist-core/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,7 @@
973973
<include>src/main/java/org/exist/xquery/ErrorCodes.java</include>
974974
<include>src/test/java/org/exist/xquery/ForwardReferenceTest.java</include>
975975
<include>src/main/java/org/exist/xquery/FunctionFactory.java</include>
976+
<include>src/main/java/org/exist/xquery/LocationStep.java</include>
976977
<include>src/main/java/org/exist/xquery/Optimizer.java</include>
977978
<include>src/main/java/org/exist/xquery/PerformanceStatsImpl.java</include>
978979
<include>src/main/java/org/exist/xquery/TryCatchExpression.java</include>
@@ -1338,6 +1339,7 @@
13381339
<exclude>src/main/java/org/exist/xquery/JavaBinding.java</exclude>
13391340
<exclude>src/test/resources-filtered/org/exist/xquery/JavaBindingTest.conf.xml</exclude>
13401341
<exclude>src/test/java/org/exist/xquery/JavaBindingTest.java</exclude>
1342+
<exclude>src/main/java/org/exist/xquery/LocationStep.java</exclude>
13411343
<exclude>src/main/java/org/exist/xquery/Materializable.java</exclude>
13421344
<exclude>src/main/java/org/exist/xquery/NameTest.java</exclude>
13431345
<exclude>src/main/java/org/exist/xquery/Optimizer.java</exclude>

exist-core/src/main/java/org/exist/xquery/LocationStep.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
/*
2+
* Elemental
3+
* Copyright (C) 2024, Evolved Binary Ltd
4+
*
5+
6+
* https://www.evolvedbinary.com | https://www.elemental.xyz
7+
*
8+
* This library is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; version 2.1.
11+
*
12+
* This library is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this library; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+
*
21+
* NOTE: Parts of this file contain code from 'The eXist-db Authors'.
22+
* The original license header is included below.
23+
*
24+
* =====================================================================
25+
*
226
* eXist-db Open Source Native XML Database
327
* Copyright (C) 2001 The eXist-db Authors
428
*
@@ -47,6 +71,7 @@
4771
* to the {@link #eval(Sequence, Item)} method) has changed.
4872
*
4973
* @author wolf
74+
* @author <a href="mailto:[email protected]">Adam Retter</a>
5075
*/
5176
public class LocationStep extends Step {
5277

@@ -501,6 +526,9 @@ private Sequence getSelf(final XQueryContext context, final Sequence contextSequ
501526
if (ns != null) {
502527
@Nullable final NodeProxy np = ns.get(p);
503528
if (np != null) {
529+
if (p.getMatches() != null) {
530+
np.addMatch(p.getMatches());
531+
}
504532
p = np;
505533
}
506534
}

0 commit comments

Comments
 (0)