• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eXist-db / exist / 41072693145

30 Oct 2026 02:33PM UTC coverage: 58.179% (-0.02%) from 58.197%
41072693145

push

github

web-flow
Merge pull request #6887 from duncdrum/bugfix/locale-xquery-functions

[bugfix] Make XQuery functions independent of the JVM default locale

32502 of 61726 branches covered (52.66%)

Branch coverage included in aggregate %.

24 of 35 new or added lines in 7 files covered. (68.57%)

62 existing lines in 8 files now uncovered.

85568 of 141218 relevant lines covered (60.59%)

2.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

45.31
/exist-core/src/main/java/org/exist/xquery/DebuggableExpression.java
1
/*
2
 * eXist-db Open Source Native XML Database
3
 * Copyright (C) 2001 The eXist-db Authors
4
 *
5
 * info@exist-db.org
6
 * http://www.exist-db.org
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; either
11
 * version 2.1 of the License, or (at your option) any later version.
12
 *
13
 * This library is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public
19
 * License along with this library; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21
 */
22
package org.exist.xquery;
23

24
import org.exist.source.Source;
25
import org.exist.xquery.value.Sequence;
26
import org.exist.xquery.value.Item;
27
import org.exist.xquery.util.ExpressionDumper;
28
import org.exist.xquery.parser.XQueryAST;
29
import org.exist.dom.persistent.DocumentSet;
30

31
public class DebuggableExpression implements Expression, RewritableExpression {
32

33
    private Expression expression;
34

35
    protected int line = -1;
3 ✔
36
    protected int column = -1;
3 ✔
37

38
    public DebuggableExpression(Expression expression) {
2 ✔
39
            this.expression = expression.simplify();
4 ✔
40
            this.line = this.expression.getLine();
5 ✔
41
            this.column = this.expression.getColumn();
5 ✔
42
    }
1 ✔
43

44
    public int getExpressionId() {
45
        return expression.getExpressionId();
×
46
    }
47

48
    public void analyze(AnalyzeContextInfo contextInfo) throws XPathException {
49
        if (contextInfo.getParent() == null) {
3 !
50
            contextInfo.setParent(this);
×
51
        }
52
        expression.analyze(contextInfo);
4 ✔
53
    }
1 ✔
54

55
    public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
56
        try {
57
            expression.getContext().expressionStart(expression);
6 ✔
58
            return expression.eval(contextSequence, contextItem);
8 ✔
59
        } finally {
60
            expression.getContext().expressionEnd(expression);
6 ✔
61
        }
62
    }
63

64
    public void setPrimaryAxis(int axis) {
65
        expression.setPrimaryAxis(axis);
×
66
    }
×
67

68
    public int getPrimaryAxis() {
69
        return expression.getPrimaryAxis();
×
70
    }
71

72
    public int returnsType() {
73
        return expression.returnsType();
4 ✔
74
    }
75

76
    @Override
77
    public Cardinality getCardinality() {
78
        return expression.getCardinality();
×
79
    }
80

81
    public int getDependencies() {
82
        return expression.getDependencies();
4 ✔
83
    }
84

85
    public void resetState(boolean postOptimization) {
86
        expression.resetState(postOptimization);
4 ✔
87
    }
1 ✔
88

89
    public boolean needsReset() {
90
            return true;
×
91
    }
92

93
    public void accept(ExpressionVisitor visitor) {
94
        expression.accept(visitor);
4 ✔
95
    }
1 ✔
96

97
    public void dump(ExpressionDumper dumper) {
98
        expression.dump(dumper);
4 ✔
99
    }
1 ✔
100

101
    public void setContextDocSet(DocumentSet contextSet) {
102
        expression.setContextDocSet(contextSet);
×
103
    }
×
104

105
    public void setContextId(int contextId) {
106
        expression.setContextId(contextId);
×
107
    }
×
108

109
    public int getContextId() {
110
        return expression.getContextId();
4 ✔
111
    }
112

113
    public DocumentSet getContextDocSet() {
114
        return expression.getContextDocSet();
×
115
    }
116

117
   public void setASTNode(XQueryAST ast) {
118
        if (ast != null) {
×
119
            line = ast.getLine();
×
120
            column = ast.getColumn();
×
121
        }
122
   }
×
123

124
    public void setLocation(int line, int column) {
125
        this.line = line;
×
126
        this.column = column;
×
127
    }
×
128

129
    public int getLine() {
UNCOV
130
        return line;
×
131
    }
132

133
    public int getColumn() {
134
        return column;
×
135
    }
136

137
    public XQueryContext getContext() {
138
        return expression.getContext();
×
139
    }
140

141
    public Source getSource() {
142
        return expression.getSource();
×
143
    }
144

145
    public int getSubExpressionCount() {
146
        return expression.getSubExpressionCount();
×
147
    }
148

149
    public Expression getSubExpression(int index) {
150
        return expression.getSubExpression(index);
×
151
    }
152

153
    @Override
154
    public void replace(Expression oldExpr, Expression newExpr) {
155
        if (oldExpr == expression)
4 !
156
            {expression = newExpr;}
3 ✔
157
    }
1 ✔
158

159
    @Override
160
    public void remove(Expression oldExpr) throws XPathException {
161
        throw new XPathException(this, "Method remove is not supported");
×
162
    }
163

164
    @Override
165
    public Expression getPrevious(Expression current) {
166
        return null;
×
167
    }
168

169
    @Override
170
    public Expression getFirst() {
171
        return expression;
3 ✔
172
    }
173

174
    @Override
175
    public boolean allowMixedNodesInReturn() {
176
        return false;
×
177
    }
178

179
    @Override
180
    public String toString() {
181
        return expression.toString();
×
182
    }
183

184
    @Override
185
    public Expression simplify() {
186
        return this;
2 ✔
187
    }
188

189
    @Override
190
    public Expression getParent() {
191
        return null;
×
192
    }
193

194
    @Override
195
    public boolean evalNextExpressionOnEmptyContextSequence() {
196
        return false;
×
197
    }
198
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc