| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.qedeq.kernel.xml.mapper; |
| 17 |
|
|
| 18 |
|
import java.util.ArrayList; |
| 19 |
|
import java.util.HashMap; |
| 20 |
|
import java.util.List; |
| 21 |
|
import java.util.Map; |
| 22 |
|
|
| 23 |
|
import org.qedeq.base.trace.Trace; |
| 24 |
|
import org.qedeq.base.utility.Enumerator; |
| 25 |
|
import org.qedeq.kernel.base.list.ElementList; |
| 26 |
|
import org.qedeq.kernel.base.module.Author; |
| 27 |
|
import org.qedeq.kernel.base.module.AuthorList; |
| 28 |
|
import org.qedeq.kernel.base.module.Axiom; |
| 29 |
|
import org.qedeq.kernel.base.module.Chapter; |
| 30 |
|
import org.qedeq.kernel.base.module.ChapterList; |
| 31 |
|
import org.qedeq.kernel.base.module.Formula; |
| 32 |
|
import org.qedeq.kernel.base.module.FunctionDefinition; |
| 33 |
|
import org.qedeq.kernel.base.module.Header; |
| 34 |
|
import org.qedeq.kernel.base.module.Import; |
| 35 |
|
import org.qedeq.kernel.base.module.ImportList; |
| 36 |
|
import org.qedeq.kernel.base.module.Latex; |
| 37 |
|
import org.qedeq.kernel.base.module.LatexList; |
| 38 |
|
import org.qedeq.kernel.base.module.LinkList; |
| 39 |
|
import org.qedeq.kernel.base.module.LiteratureItem; |
| 40 |
|
import org.qedeq.kernel.base.module.LiteratureItemList; |
| 41 |
|
import org.qedeq.kernel.base.module.Location; |
| 42 |
|
import org.qedeq.kernel.base.module.LocationList; |
| 43 |
|
import org.qedeq.kernel.base.module.Node; |
| 44 |
|
import org.qedeq.kernel.base.module.PredicateDefinition; |
| 45 |
|
import org.qedeq.kernel.base.module.Proof; |
| 46 |
|
import org.qedeq.kernel.base.module.ProofList; |
| 47 |
|
import org.qedeq.kernel.base.module.Proposition; |
| 48 |
|
import org.qedeq.kernel.base.module.Qedeq; |
| 49 |
|
import org.qedeq.kernel.base.module.Rule; |
| 50 |
|
import org.qedeq.kernel.base.module.Section; |
| 51 |
|
import org.qedeq.kernel.base.module.SectionList; |
| 52 |
|
import org.qedeq.kernel.base.module.Specification; |
| 53 |
|
import org.qedeq.kernel.base.module.Subsection; |
| 54 |
|
import org.qedeq.kernel.base.module.SubsectionList; |
| 55 |
|
import org.qedeq.kernel.base.module.Term; |
| 56 |
|
import org.qedeq.kernel.base.module.UsedByList; |
| 57 |
|
import org.qedeq.kernel.base.module.VariableList; |
| 58 |
|
import org.qedeq.kernel.common.ModuleContext; |
| 59 |
|
import org.qedeq.kernel.common.ModuleDataException; |
| 60 |
|
import org.qedeq.kernel.visitor.AbstractModuleVisitor; |
| 61 |
|
import org.qedeq.kernel.visitor.QedeqNotNullTraverser; |
| 62 |
|
import org.qedeq.kernel.xml.tracker.SimpleXPath; |
| 63 |
|
|
| 64 |
|
|
| 65 |
|
|
| 66 |
|
|
| 67 |
|
@link |
| 68 |
|
|
| 69 |
|
|
| 70 |
|
|
| 71 |
|
@link |
| 72 |
|
|
| 73 |
|
|
| 74 |
|
|
| 75 |
|
|
| 76 |
|
|
| 77 |
|
|
| 78 |
|
|
| 79 |
|
|
| 80 |
|
|
| 81 |
|
|
| 82 |
|
@version |
| 83 |
|
@author |
| 84 |
|
|
|
|
|
| 91.9% |
Uncovered Elements: 41 (505) |
Complexity: 109 |
Complexity Density: 0.29 |
|
| 85 |
|
public final class Context2SimpleXPath extends AbstractModuleVisitor { |
| 86 |
|
|
| 87 |
|
|
| 88 |
|
private static final Class CLASS = Context2SimpleXPath.class; |
| 89 |
|
|
| 90 |
|
|
| 91 |
|
private QedeqNotNullTraverser traverser; |
| 92 |
|
|
| 93 |
|
|
| 94 |
|
private Qedeq qedeq; |
| 95 |
|
|
| 96 |
|
|
| 97 |
|
private final ModuleContext find; |
| 98 |
|
|
| 99 |
|
|
| 100 |
|
private SimpleXPath current; |
| 101 |
|
|
| 102 |
|
|
| 103 |
|
private final List elements; |
| 104 |
|
|
| 105 |
|
|
| 106 |
|
private int level; |
| 107 |
|
|
| 108 |
|
|
| 109 |
|
private boolean matching; |
| 110 |
|
|
| 111 |
|
@link |
| 112 |
|
private String matchingBegin; |
| 113 |
|
|
| 114 |
|
@link |
| 115 |
|
private SimpleXPath matchingPath; |
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
@param |
| 121 |
|
@param |
| 122 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 123 |
33445
|
private Context2SimpleXPath(final ModuleContext find, final Qedeq qedeq) {... |
| 124 |
33445
|
this.qedeq = qedeq; |
| 125 |
33445
|
traverser = new QedeqNotNullTraverser(find.getModuleLocation(), this); |
| 126 |
33445
|
this.find = find; |
| 127 |
33445
|
elements = new ArrayList(20); |
| 128 |
|
} |
| 129 |
|
|
| 130 |
|
|
| 131 |
|
@link |
| 132 |
|
|
| 133 |
|
|
| 134 |
|
|
| 135 |
|
@link |
| 136 |
|
|
| 137 |
|
|
| 138 |
|
|
| 139 |
|
|
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| 143 |
|
|
| 144 |
|
|
| 145 |
|
|
| 146 |
|
|
| 147 |
|
|
| 148 |
|
|
| 149 |
|
|
| 150 |
|
@param |
| 151 |
|
@param |
| 152 |
|
@return |
| 153 |
|
@throws |
| 154 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 155 |
33445
|
public static SimpleXPath getXPath(final ModuleContext find, final Qedeq qedeq)... |
| 156 |
|
throws ModuleDataException { |
| 157 |
33445
|
final Context2SimpleXPath converter = new Context2SimpleXPath(find, qedeq); |
| 158 |
33445
|
return converter.find(); |
| 159 |
|
} |
| 160 |
|
|
|
|
|
| 75% |
Uncovered Elements: 3 (12) |
Complexity: 2 |
Complexity Density: 0.17 |
|
| 161 |
33445
|
private final SimpleXPath find() throws ModuleDataException {... |
| 162 |
33445
|
final String method = "find()"; |
| 163 |
33445
|
Trace.paramInfo(CLASS, this, method, "find", find); |
| 164 |
33445
|
elements.clear(); |
| 165 |
33445
|
level = 0; |
| 166 |
33445
|
current = new SimpleXPath(); |
| 167 |
33445
|
try { |
| 168 |
33445
|
traverser.accept(qedeq); |
| 169 |
|
} catch (LocationFoundException e) { |
| 170 |
33445
|
Trace.paramInfo(CLASS, this, method, "location found", current); |
| 171 |
33445
|
return current; |
| 172 |
|
} |
| 173 |
0
|
Trace.param(CLASS, this, method, "level", level); |
| 174 |
0
|
Trace.info(CLASS, this, method, "location was not found"); |
| 175 |
0
|
throw new LocationNotFoundException(find); |
| 176 |
|
} |
| 177 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 178 |
33445
|
public final void visitEnter(final Qedeq qedeq) throws ModuleDataException {... |
| 179 |
33445
|
enter("QEDEQ"); |
| 180 |
33445
|
final String method = "visitEnter(Qedeq)"; |
| 181 |
33445
|
Trace.param(CLASS, this, method, "current", current); |
| 182 |
33445
|
checkMatching(method); |
| 183 |
|
} |
| 184 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 185 |
0
|
public final void visitLeave(final Qedeq qedeq) {... |
| 186 |
0
|
leave(); |
| 187 |
|
} |
| 188 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
| 189 |
33443
|
public final void visitEnter(final Header header) throws ModuleDataException {... |
| 190 |
33443
|
enter("HEADER"); |
| 191 |
33443
|
final String method = "visitEnter(Header)"; |
| 192 |
33443
|
Trace.param(CLASS, this, method, "current", current); |
| 193 |
33443
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 194 |
33443
|
checkMatching(method); |
| 195 |
|
|
| 196 |
33430
|
traverser.setLocationWithinModule(context + ".getEmail()"); |
| 197 |
33430
|
current.setAttribute("email"); |
| 198 |
33430
|
checkIfFound(); |
| 199 |
|
} |
| 200 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 201 |
32931
|
public final void visitLeave(final Header header) {... |
| 202 |
32931
|
leave(); |
| 203 |
|
} |
| 204 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 1 |
Complexity Density: 0.09 |
|
| 205 |
607
|
public final void visitEnter(final Specification specification) throws ModuleDataException {... |
| 206 |
607
|
enter("SPECIFICATION"); |
| 207 |
607
|
final String method = "visitEnter(Specification)"; |
| 208 |
607
|
Trace.param(CLASS, this, method, "current", current); |
| 209 |
607
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 210 |
607
|
checkMatching(method); |
| 211 |
|
|
| 212 |
559
|
traverser.setLocationWithinModule(context + ".getName()"); |
| 213 |
559
|
current.setAttribute("name"); |
| 214 |
559
|
checkIfFound(); |
| 215 |
|
|
| 216 |
537
|
traverser.setLocationWithinModule(context + ".getRuleVersion()"); |
| 217 |
537
|
current.setAttribute("ruleVersion"); |
| 218 |
537
|
checkIfFound(); |
| 219 |
|
} |
| 220 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 221 |
383
|
public final void visitLeave(final Specification specification) {... |
| 222 |
383
|
leave(); |
| 223 |
|
} |
| 224 |
|
|
|
|
|
| 96.1% |
Uncovered Elements: 2 (51) |
Complexity: 12 |
Complexity Density: 0.41 |
|
| 225 |
182269
|
public final void visitEnter(final LatexList latexList) throws ModuleDataException {... |
| 226 |
182269
|
final String method = "visitEnter(LatexList)"; |
| 227 |
182269
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 228 |
182269
|
final String name; |
| 229 |
182269
|
if (context.endsWith(".getTitle()")) { |
| 230 |
77353
|
name = "TITLE"; |
| 231 |
104916
|
} else if (context.endsWith(".getSummary()")) { |
| 232 |
337
|
name = "ABSTRACT"; |
| 233 |
104579
|
} else if (context.endsWith(".getIntroduction()")) { |
| 234 |
63680
|
name = "INTRODUCTION"; |
| 235 |
40899
|
} else if (context.endsWith(".getName()")) { |
| 236 |
13154
|
name = "NAME"; |
| 237 |
27745
|
} else if (context.endsWith(".getPrecedingText()")) { |
| 238 |
26699
|
name = "PRECEDING"; |
| 239 |
1046
|
} else if (context.endsWith(".getSucceedingText()")) { |
| 240 |
334
|
name = "SUCCEEDING"; |
| 241 |
712
|
} else if (context.endsWith(".getLatex()")) { |
| 242 |
166
|
name = "TEXT"; |
| 243 |
546
|
} else if (context.endsWith(".getDescription()")) { |
| 244 |
184
|
name = "DESCRIPTION"; |
| 245 |
362
|
} else if (context.endsWith(".getNonFormalProof()")) { |
| 246 |
264
|
name = null; |
| 247 |
98
|
} else if (context.endsWith(".getItem()")) { |
| 248 |
98
|
name = null; |
| 249 |
|
} else { |
| 250 |
0
|
throw new IllegalArgumentException("unknown LatexList " + context); |
| 251 |
|
} |
| 252 |
182269
|
Trace.param(CLASS, this, method, "name", name); |
| 253 |
182269
|
if (name != null) { |
| 254 |
181907
|
enter(name); |
| 255 |
|
} |
| 256 |
182269
|
Trace.param(CLASS, this, method, "current", current); |
| 257 |
|
|
| 258 |
182269
|
checkMatching(method); |
| 259 |
|
} |
| 260 |
|
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
| 261 |
176495
|
public final void visitLeave(final LatexList latexList) {... |
| 262 |
176495
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 263 |
176495
|
if (!context.endsWith(".getNonFormalProof()") |
| 264 |
|
&& !context.endsWith(".getItem()")) { |
| 265 |
176495
|
leave(); |
| 266 |
|
} |
| 267 |
|
} |
| 268 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 2 |
Complexity Density: 0.15 |
|
| 269 |
4451
|
public final void visitEnter(final Latex latex) throws ModuleDataException {... |
| 270 |
4451
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 271 |
4451
|
if (context.indexOf(".getAuthorList().get(") >= 0) { |
| 272 |
13
|
enter("NAME"); |
| 273 |
|
} |
| 274 |
4451
|
enter("LATEX"); |
| 275 |
4451
|
final String method = "visitEnter(Latex)"; |
| 276 |
4451
|
Trace.param(CLASS, this, method, "current", current); |
| 277 |
4451
|
checkMatching(method); |
| 278 |
|
|
| 279 |
1402
|
traverser.setLocationWithinModule(context + ".getLanguage()"); |
| 280 |
1402
|
current.setAttribute("language"); |
| 281 |
1402
|
checkIfFound(); |
| 282 |
|
|
| 283 |
1402
|
traverser.setLocationWithinModule(context + ".getLatex()"); |
| 284 |
1402
|
current.setAttribute(null); |
| 285 |
1402
|
checkIfFound(); |
| 286 |
|
} |
| 287 |
|
|
|
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 288 |
1402
|
public final void visitLeave(final Latex latex) {... |
| 289 |
|
|
| 290 |
1402
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 291 |
1402
|
if (context.indexOf(".getAuthorList().get(") >= 0) { |
| 292 |
0
|
leave(); |
| 293 |
|
} |
| 294 |
1402
|
leave(); |
| 295 |
|
} |
| 296 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 297 |
132
|
public final void visitEnter(final LocationList locationList) throws ModuleDataException {... |
| 298 |
132
|
enter("LOCATIONS"); |
| 299 |
132
|
final String method = "visitEnter(LocationList)"; |
| 300 |
132
|
Trace.param(CLASS, this, method, "current", current); |
| 301 |
132
|
checkMatching(method); |
| 302 |
|
|
| 303 |
|
} |
| 304 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 305 |
0
|
public final void visitLeave(final LocationList locationList) {... |
| 306 |
0
|
leave(); |
| 307 |
|
} |
| 308 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
| 309 |
98
|
public final void visitEnter(final Location location) throws ModuleDataException {... |
| 310 |
98
|
enter("LOCATION"); |
| 311 |
98
|
final String method = "visitEnter(Location)"; |
| 312 |
98
|
Trace.param(CLASS, this, method, "current", current); |
| 313 |
98
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 314 |
98
|
checkMatching(method); |
| 315 |
|
|
| 316 |
40
|
traverser.setLocationWithinModule(context + ".getLocation()"); |
| 317 |
40
|
current.setAttribute("value"); |
| 318 |
40
|
checkIfFound(); |
| 319 |
|
} |
| 320 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 321 |
14
|
public final void visitLeave(final Location location) {... |
| 322 |
14
|
leave(); |
| 323 |
|
} |
| 324 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 325 |
291
|
public final void visitEnter(final AuthorList authorList) throws ModuleDataException {... |
| 326 |
291
|
enter("AUTHORS"); |
| 327 |
291
|
final String method = "visitEnter(AuthorList)"; |
| 328 |
291
|
Trace.param(CLASS, this, method, "current", current); |
| 329 |
291
|
checkMatching(method); |
| 330 |
|
} |
| 331 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 332 |
219
|
public final void visitLeave(final AuthorList authorList) {... |
| 333 |
219
|
leave(); |
| 334 |
|
} |
| 335 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
| 336 |
48
|
public final void visitEnter(final Author author) throws ModuleDataException {... |
| 337 |
48
|
enter("AUTHOR"); |
| 338 |
48
|
final String method = "visitEnter(Author)"; |
| 339 |
48
|
Trace.param(CLASS, this, method, "current", current); |
| 340 |
48
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 341 |
48
|
checkMatching(method); |
| 342 |
|
|
| 343 |
24
|
traverser.setLocationWithinModule(context + ".getEmail()"); |
| 344 |
24
|
current.setAttribute("email"); |
| 345 |
24
|
checkIfFound(); |
| 346 |
|
} |
| 347 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 348 |
0
|
public final void visitLeave(final Author author) {... |
| 349 |
0
|
leave(); |
| 350 |
|
} |
| 351 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 352 |
197
|
public final void visitEnter(final ImportList importList) throws ModuleDataException {... |
| 353 |
197
|
enter("IMPORTS"); |
| 354 |
197
|
final String method = "visitEnter(ImportList)"; |
| 355 |
197
|
Trace.param(CLASS, this, method, "current", current); |
| 356 |
197
|
checkMatching(method); |
| 357 |
|
} |
| 358 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 359 |
33
|
public final void visitLeave(final ImportList importList) {... |
| 360 |
33
|
leave(); |
| 361 |
|
} |
| 362 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
| 363 |
196
|
public final void visitEnter(final Import imp) throws ModuleDataException {... |
| 364 |
196
|
enter("IMPORT"); |
| 365 |
196
|
final String method = "visitEnter(Import)"; |
| 366 |
196
|
Trace.param(CLASS, this, method, "current", current); |
| 367 |
196
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 368 |
196
|
checkMatching(method); |
| 369 |
|
|
| 370 |
182
|
traverser.setLocationWithinModule(context + ".getLabel()"); |
| 371 |
182
|
current.setAttribute("label"); |
| 372 |
182
|
checkIfFound(); |
| 373 |
|
} |
| 374 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 375 |
44
|
public final void visitLeave(final Import imp) {... |
| 376 |
44
|
leave(); |
| 377 |
|
} |
| 378 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 379 |
55
|
public final void visitEnter(final UsedByList usedByList) throws ModuleDataException {... |
| 380 |
55
|
enter("USEDBY"); |
| 381 |
55
|
final String method = "visitEnter(UsedByList)"; |
| 382 |
55
|
Trace.param(CLASS, this, method, "current", current); |
| 383 |
55
|
checkMatching(method); |
| 384 |
|
} |
| 385 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 386 |
0
|
public final void visitLeave(final UsedByList usedByList) {... |
| 387 |
0
|
leave(); |
| 388 |
|
} |
| 389 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 390 |
32931
|
public final void visitEnter(final ChapterList chapterList) throws ModuleDataException {... |
| 391 |
32931
|
final String method = "visitEnter(ChapterList)"; |
| 392 |
|
|
| 393 |
|
|
| 394 |
32931
|
checkMatching(method); |
| 395 |
|
} |
| 396 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 397 |
170
|
public final void visitLeave(final ChapterList chapterList) {... |
| 398 |
170
|
traverser.setBlocked(false); |
| 399 |
|
} |
| 400 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
| 401 |
144512
|
public final void visitEnter(final Chapter chapter) throws ModuleDataException {... |
| 402 |
144512
|
enter("CHAPTER"); |
| 403 |
144512
|
final String method = "visitEnter(Chapter)"; |
| 404 |
144512
|
Trace.param(CLASS, this, method, "current", current); |
| 405 |
144512
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 406 |
144512
|
checkMatching(method); |
| 407 |
|
|
| 408 |
144386
|
traverser.setLocationWithinModule(context + ".getNoNumber()"); |
| 409 |
144386
|
current.setAttribute("noNumber"); |
| 410 |
144386
|
checkIfFound(); |
| 411 |
|
} |
| 412 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 413 |
111764
|
public final void visitLeave(final Chapter chapter) {... |
| 414 |
111764
|
leave(); |
| 415 |
|
} |
| 416 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 417 |
32117
|
public final void visitEnter(final SectionList sectionList) throws ModuleDataException {... |
| 418 |
32117
|
final String method = "visitEnter(SectionList)"; |
| 419 |
|
|
| 420 |
|
|
| 421 |
32117
|
checkMatching(method); |
| 422 |
|
} |
| 423 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 424 |
0
|
public final void visitLeave(final SectionList sectionList) {... |
| 425 |
0
|
traverser.setBlocked(false); |
| 426 |
|
} |
| 427 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
| 428 |
76787
|
public final void visitEnter(final Section section) throws ModuleDataException {... |
| 429 |
76787
|
enter("SECTION"); |
| 430 |
76787
|
final String method = "visitEnter(Section)"; |
| 431 |
76787
|
Trace.param(CLASS, this, method, "current", current); |
| 432 |
76787
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 433 |
76787
|
checkMatching(method); |
| 434 |
|
|
| 435 |
76553
|
traverser.setLocationWithinModule(context + ".getNoNumber()"); |
| 436 |
76553
|
current.setAttribute("noNumber"); |
| 437 |
76553
|
checkIfFound(); |
| 438 |
|
} |
| 439 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 440 |
44746
|
public final void visitLeave(final Section section) {... |
| 441 |
44746
|
leave(); |
| 442 |
|
} |
| 443 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 444 |
30887
|
public final void visitEnter(final SubsectionList subsectionList) throws ModuleDataException {... |
| 445 |
30887
|
enter("SUBSECTIONS"); |
| 446 |
30887
|
final String method = "visitEnter(SubsectionList)"; |
| 447 |
30887
|
Trace.param(CLASS, this, method, "current", current); |
| 448 |
30887
|
checkMatching(method); |
| 449 |
|
} |
| 450 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 451 |
0
|
public final void visitLeave(final SubsectionList subsectionList) {... |
| 452 |
0
|
leave(); |
| 453 |
|
} |
| 454 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 1 |
Complexity Density: 0.09 |
|
| 455 |
3600
|
public final void visitEnter(final Subsection subsection) throws ModuleDataException {... |
| 456 |
3600
|
enter("SUBSECTION"); |
| 457 |
3600
|
final String method = "visitEnter(Subsection)"; |
| 458 |
3600
|
Trace.param(CLASS, this, method, "current", current); |
| 459 |
3600
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 460 |
3600
|
checkMatching(method); |
| 461 |
|
|
| 462 |
3498
|
traverser.setLocationWithinModule(context + ".getId()"); |
| 463 |
3498
|
current.setAttribute("id"); |
| 464 |
3498
|
checkIfFound(); |
| 465 |
|
|
| 466 |
3498
|
traverser.setLocationWithinModule(context + ".getLevel()"); |
| 467 |
3498
|
current.setAttribute("level"); |
| 468 |
3498
|
checkIfFound(); |
| 469 |
|
} |
| 470 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 471 |
3212
|
public final void visitLeave(final Subsection subsection) {... |
| 472 |
3212
|
leave(); |
| 473 |
|
} |
| 474 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 1 |
Complexity Density: 0.07 |
|
| 475 |
154435
|
public final void visitEnter(final Node node) throws ModuleDataException {... |
| 476 |
154435
|
enter("NODE"); |
| 477 |
154435
|
final String method = "visitEnter(Node)"; |
| 478 |
154435
|
Trace.param(CLASS, this, method, "current", current); |
| 479 |
154435
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 480 |
154435
|
checkMatching(method); |
| 481 |
|
|
| 482 |
153709
|
traverser.setLocationWithinModule(context + ".getId()"); |
| 483 |
153709
|
current.setAttribute("id"); |
| 484 |
153709
|
checkIfFound(); |
| 485 |
|
|
| 486 |
153439
|
traverser.setLocationWithinModule(context + ".getLevel()"); |
| 487 |
153439
|
current.setAttribute("level"); |
| 488 |
153439
|
checkIfFound(); |
| 489 |
|
|
| 490 |
|
|
| 491 |
153286
|
traverser.setLocationWithinModule(context + ".getNodeType()"); |
| 492 |
153286
|
current.setAttribute(null); |
| 493 |
153286
|
checkIfFound(); |
| 494 |
|
|
| 495 |
|
} |
| 496 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 497 |
124066
|
public final void visitLeave(final Node node) {... |
| 498 |
124066
|
leave(); |
| 499 |
|
} |
| 500 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 501 |
2589
|
public final void visitEnter(final Axiom axiom) throws ModuleDataException {... |
| 502 |
2589
|
enter("AXIOM"); |
| 503 |
2589
|
final String method = "visitEnter(Axiom)"; |
| 504 |
2589
|
Trace.param(CLASS, this, method, "current", current); |
| 505 |
2589
|
checkMatching(method); |
| 506 |
|
} |
| 507 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 508 |
82
|
public final void visitLeave(final Axiom axiom) {... |
| 509 |
82
|
leave(); |
| 510 |
|
} |
| 511 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 512 |
19020
|
public final void visitEnter(final Proposition proposition) throws ModuleDataException {... |
| 513 |
19020
|
enter("THEOREM"); |
| 514 |
19020
|
final String method = "visitEnter(Proposition)"; |
| 515 |
19020
|
Trace.param(CLASS, this, method, "current", current); |
| 516 |
19020
|
checkMatching(method); |
| 517 |
|
} |
| 518 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 519 |
84
|
public final void visitLeave(final Proposition proposition) {... |
| 520 |
84
|
leave(); |
| 521 |
|
} |
| 522 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 523 |
603
|
public final void visitEnter(final ProofList proofList) throws ModuleDataException {... |
| 524 |
603
|
final String method = "visitEnter(ProofList)"; |
| 525 |
|
|
| 526 |
|
|
| 527 |
603
|
checkMatching(method); |
| 528 |
|
} |
| 529 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 1 |
Complexity Density: 0.09 |
|
| 530 |
521
|
public final void visitEnter(final Proof proof) throws ModuleDataException {... |
| 531 |
521
|
enter("PROOF"); |
| 532 |
521
|
final String method = "visitEnter(Proof)"; |
| 533 |
521
|
Trace.param(CLASS, this, method, "current", current); |
| 534 |
521
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 535 |
521
|
checkMatching(method); |
| 536 |
|
|
| 537 |
368
|
traverser.setLocationWithinModule(context + ".getKind()"); |
| 538 |
368
|
current.setAttribute("kind"); |
| 539 |
368
|
checkIfFound(); |
| 540 |
|
|
| 541 |
329
|
traverser.setLocationWithinModule(context + ".getLevel()"); |
| 542 |
329
|
current.setAttribute("level"); |
| 543 |
329
|
checkIfFound(); |
| 544 |
|
} |
| 545 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 546 |
26
|
public final void visitLeave(final Proof proof) {... |
| 547 |
26
|
leave(); |
| 548 |
|
} |
| 549 |
|
|
|
|
|
| 90.9% |
Uncovered Elements: 2 (22) |
Complexity: 3 |
Complexity Density: 0.17 |
|
| 550 |
1856
|
public final void visitEnter(final PredicateDefinition definition) throws ModuleDataException {... |
| 551 |
1856
|
enter("DEFINITION_PREDICATE"); |
| 552 |
1856
|
final String method = "visitEnter(PredicateDefinition)"; |
| 553 |
1856
|
Trace.param(CLASS, this, method, "current", current); |
| 554 |
1856
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 555 |
1856
|
checkMatching(method); |
| 556 |
|
|
| 557 |
1760
|
traverser.setLocationWithinModule(context + ".getArgumentNumber()"); |
| 558 |
1760
|
current.setAttribute("arguments"); |
| 559 |
1760
|
checkIfFound(); |
| 560 |
|
|
| 561 |
1720
|
traverser.setLocationWithinModule(context + ".getName()"); |
| 562 |
1720
|
current.setAttribute("name"); |
| 563 |
1720
|
checkIfFound(); |
| 564 |
|
|
| 565 |
1680
|
traverser.setLocationWithinModule(context + ".getLatexPattern()"); |
| 566 |
1680
|
enter("LATEXPATTERN"); |
| 567 |
1680
|
if (find.getLocationWithinModule().equals(traverser.getCurrentContext() |
| 568 |
|
.getLocationWithinModule())) { |
| 569 |
40
|
if (definition.getLatexPattern() == null) { |
| 570 |
0
|
leave(); |
| 571 |
|
} |
| 572 |
40
|
throw new LocationFoundException(traverser.getCurrentContext()); |
| 573 |
|
} |
| 574 |
1640
|
leave(); |
| 575 |
|
} |
| 576 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 577 |
88
|
public final void visitLeave(final PredicateDefinition definition) {... |
| 578 |
88
|
leave(); |
| 579 |
|
} |
| 580 |
|
|
|
|
|
| 90.9% |
Uncovered Elements: 2 (22) |
Complexity: 3 |
Complexity Density: 0.17 |
|
| 581 |
2062
|
public final void visitEnter(final FunctionDefinition definition) throws ModuleDataException {... |
| 582 |
2062
|
enter("DEFINITION_FUNCTION"); |
| 583 |
2062
|
final String method = "visitEnter(FunctionDefinition)"; |
| 584 |
2062
|
Trace.param(CLASS, this, method, "current", current); |
| 585 |
2062
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 586 |
2062
|
checkMatching(method); |
| 587 |
|
|
| 588 |
1966
|
traverser.setLocationWithinModule(context + ".getArgumentNumber()"); |
| 589 |
1966
|
current.setAttribute("arguments"); |
| 590 |
1966
|
checkIfFound(); |
| 591 |
|
|
| 592 |
1934
|
traverser.setLocationWithinModule(context + ".getName()"); |
| 593 |
1934
|
current.setAttribute("name"); |
| 594 |
1934
|
checkIfFound(); |
| 595 |
|
|
| 596 |
1902
|
traverser.setLocationWithinModule(context + ".getLatexPattern()"); |
| 597 |
1902
|
enter("LATEXPATTERN"); |
| 598 |
1902
|
if (find.getLocationWithinModule().equals(traverser.getCurrentContext() |
| 599 |
|
.getLocationWithinModule())) { |
| 600 |
32
|
if (definition.getLatexPattern() == null) { |
| 601 |
0
|
leave(); |
| 602 |
|
} |
| 603 |
32
|
throw new LocationFoundException(traverser.getCurrentContext()); |
| 604 |
|
} |
| 605 |
1870
|
leave(); |
| 606 |
|
} |
| 607 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 608 |
42
|
public final void visitLeave(final FunctionDefinition definition) {... |
| 609 |
42
|
leave(); |
| 610 |
|
} |
| 611 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
| 612 |
283
|
public final void visitEnter(final Rule rule) throws ModuleDataException {... |
| 613 |
283
|
enter("RULE"); |
| 614 |
283
|
final String method = "visitEnter(Rule)"; |
| 615 |
283
|
Trace.param(CLASS, this, method, "current", current); |
| 616 |
283
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 617 |
283
|
checkMatching(method); |
| 618 |
|
|
| 619 |
216
|
traverser.setLocationWithinModule(context + ".getName()"); |
| 620 |
216
|
current.setAttribute("name"); |
| 621 |
216
|
checkIfFound(); |
| 622 |
|
} |
| 623 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 624 |
38
|
public final void visitLeave(final Rule rule) {... |
| 625 |
38
|
leave(); |
| 626 |
|
} |
| 627 |
|
|
|
|
|
| 93.8% |
Uncovered Elements: 1 (16) |
Complexity: 3 |
Complexity Density: 0.25 |
|
| 628 |
22
|
public final void visitEnter(final LinkList linkList) throws ModuleDataException {... |
| 629 |
22
|
final String method = "visitEnter(LinkList)"; |
| 630 |
22
|
Trace.param(CLASS, this, method, "current", current); |
| 631 |
22
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 632 |
22
|
checkMatching(method); |
| 633 |
|
|
| 634 |
30
|
for (int i = 0; i < linkList.size(); i++) { |
| 635 |
16
|
enter("LINK"); |
| 636 |
16
|
if (linkList.get(i) != null) { |
| 637 |
16
|
traverser.setLocationWithinModule(context + ".get(" + i + ")"); |
| 638 |
16
|
current.setAttribute("id"); |
| 639 |
16
|
checkIfFound(); |
| 640 |
|
} |
| 641 |
14
|
leave(); |
| 642 |
14
|
}; |
| 643 |
|
} |
| 644 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 645 |
14
|
public final void visitLeave(final LinkList linkList) {... |
| 646 |
|
} |
| 647 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 648 |
22199
|
public final void visitEnter(final Formula formula) throws ModuleDataException {... |
| 649 |
22199
|
enter("FORMULA"); |
| 650 |
22199
|
final String method = "visitEnter(Formula)"; |
| 651 |
22199
|
Trace.param(CLASS, this, method, "current", current); |
| 652 |
22199
|
checkMatching(method); |
| 653 |
|
} |
| 654 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 655 |
679
|
public final void visitLeave(final Formula formula) {... |
| 656 |
679
|
leave(); |
| 657 |
|
} |
| 658 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 659 |
1576
|
public final void visitEnter(final Term term) throws ModuleDataException {... |
| 660 |
1576
|
enter("TERM"); |
| 661 |
1576
|
final String method = "visitEnter(Term)"; |
| 662 |
1576
|
Trace.param(CLASS, this, method, "current", current); |
| 663 |
1576
|
checkMatching(method); |
| 664 |
|
} |
| 665 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 666 |
42
|
public final void visitLeave(final Term term) {... |
| 667 |
42
|
leave(); |
| 668 |
|
} |
| 669 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 670 |
3254
|
public final void visitEnter(final VariableList variableList) throws ModuleDataException {... |
| 671 |
3254
|
enter("VARLIST"); |
| 672 |
3254
|
final String method = "visitEnter(VariableList)"; |
| 673 |
3254
|
Trace.param(CLASS, this, method, "current", current); |
| 674 |
3254
|
checkMatching(method); |
| 675 |
|
} |
| 676 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 677 |
2566
|
public final void visitLeave(final VariableList variableList) {... |
| 678 |
2566
|
leave(); |
| 679 |
|
} |
| 680 |
|
|
|
|
|
| 87.1% |
Uncovered Elements: 4 (31) |
Complexity: 8 |
Complexity Density: 0.35 |
|
| 681 |
196353
|
public final void visitEnter(final ElementList list) throws ModuleDataException {... |
| 682 |
196353
|
final String operator = list.getOperator(); |
| 683 |
196353
|
enter(operator); |
| 684 |
196353
|
final String method = "visitEnter(ElementList)"; |
| 685 |
196353
|
Trace.param(CLASS, this, method, "current", current); |
| 686 |
196353
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 687 |
|
|
| 688 |
|
|
| 689 |
196353
|
if (context.startsWith(find.getLocationWithinModule())) { |
| 690 |
20492
|
throw new LocationFoundException(find); |
| 691 |
|
} |
| 692 |
|
|
| 693 |
175861
|
checkMatching(method); |
| 694 |
|
|
| 695 |
175861
|
traverser.setLocationWithinModule(context + ".getOperator()"); |
| 696 |
175861
|
checkIfFound(); |
| 697 |
175861
|
traverser.setLocationWithinModule(context); |
| 698 |
175861
|
final boolean firstIsAtom = list.size() > 0 && list.getElement(0).isAtom(); |
| 699 |
175861
|
if (firstIsAtom) { |
| 700 |
60884
|
traverser.setLocationWithinModule(context + ".getElement(0).getAtom()"); |
| 701 |
60884
|
if ("VAR".equals(operator) || "PREDVAR".equals(operator) |
| 702 |
|
|| "FUNVAR".equals(operator)) { |
| 703 |
14883
|
current.setAttribute("id"); |
| 704 |
14883
|
checkIfFound(); |
| 705 |
46001
|
} else if ("PREDCON".equals(operator) || "FUNCON".equals(operator)) { |
| 706 |
46001
|
current.setAttribute("ref"); |
| 707 |
46001
|
checkIfFound(); |
| 708 |
|
} else { |
| 709 |
0
|
current.setAttribute(null); |
| 710 |
0
|
Trace.info(CLASS, this, method, "unknown operator " + operator); |
| 711 |
0
|
throw new LocationFoundException(traverser.getCurrentContext()); |
| 712 |
|
} |
| 713 |
|
} |
| 714 |
|
} |
| 715 |
|
|
| 716 |
|
|
| 717 |
|
|
| 718 |
|
|
| 719 |
|
|
| 720 |
|
|
| 721 |
|
|
| 722 |
|
|
| 723 |
|
|
| 724 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 725 |
112835
|
public final void visitLeave(final ElementList list) {... |
| 726 |
112835
|
leave(); |
| 727 |
|
} |
| 728 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 729 |
170
|
public final void visitEnter(final LiteratureItemList list) throws ModuleDataException {... |
| 730 |
170
|
enter("BIBLIOGRAPHY"); |
| 731 |
170
|
final String method = "visitEnter(LiteratureItemList)"; |
| 732 |
170
|
Trace.param(CLASS, this, method, "current", current); |
| 733 |
170
|
checkMatching(method); |
| 734 |
|
} |
| 735 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 736 |
0
|
public final void visitLeave(final LiteratureItemList list) {... |
| 737 |
0
|
leave(); |
| 738 |
|
} |
| 739 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
| 740 |
524
|
public final void visitEnter(final LiteratureItem item) throws ModuleDataException {... |
| 741 |
524
|
enter("ITEM"); |
| 742 |
524
|
final String method = "visitEnter(LiteratureItem)"; |
| 743 |
524
|
Trace.param(CLASS, this, method, "current", current); |
| 744 |
524
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 745 |
524
|
checkMatching(method); |
| 746 |
|
|
| 747 |
478
|
traverser.setLocationWithinModule(context + ".getLabel()"); |
| 748 |
478
|
current.setAttribute("label"); |
| 749 |
478
|
checkIfFound(); |
| 750 |
|
} |
| 751 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 752 |
360
|
public final void visitLeave(final LiteratureItem item) {... |
| 753 |
360
|
leave(); |
| 754 |
|
} |
| 755 |
|
|
| 756 |
|
|
| 757 |
|
|
| 758 |
|
|
| 759 |
|
@throws |
| 760 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
| 761 |
1932518
|
private final void checkIfFound() throws LocationFoundException {... |
| 762 |
1932518
|
if (find.getLocationWithinModule().equals(traverser.getCurrentContext() |
| 763 |
|
.getLocationWithinModule())) { |
| 764 |
12881
|
throw new LocationFoundException(traverser.getCurrentContext()); |
| 765 |
|
} |
| 766 |
|
} |
| 767 |
|
|
| 768 |
|
|
| 769 |
|
|
| 770 |
|
|
| 771 |
|
@link |
| 772 |
|
|
| 773 |
|
@link |
| 774 |
|
|
| 775 |
|
@param |
| 776 |
|
@throws |
| 777 |
|
@throws |
| 778 |
|
|
|
|
|
| 60% |
Uncovered Elements: 10 (25) |
Complexity: 4 |
Complexity Density: 0.21 |
|
| 779 |
961041
|
private final void checkMatching(final String method)... |
| 780 |
|
throws LocationNotFoundException, LocationFoundException { |
| 781 |
961041
|
final String context = traverser.getCurrentContext().getLocationWithinModule(); |
| 782 |
961041
|
if (find.getLocationWithinModule().startsWith(context)) { |
| 783 |
348706
|
Trace.info(CLASS, this, method, "beginning matches"); |
| 784 |
348706
|
Trace.paramInfo(CLASS, this, method, "context", context); |
| 785 |
348706
|
matching = true; |
| 786 |
348706
|
matchingBegin = context; |
| 787 |
348706
|
matchingPath = new SimpleXPath(current); |
| 788 |
|
} else { |
| 789 |
612335
|
if (matching) { |
| 790 |
|
|
| 791 |
|
|
| 792 |
|
|
| 793 |
|
|
| 794 |
|
|
| 795 |
|
|
| 796 |
612335
|
if (!context.startsWith(matchingBegin)) { |
| 797 |
|
|
| 798 |
|
|
| 799 |
|
|
| 800 |
|
|
| 801 |
0
|
Trace.info(CLASS, this, method, "matching lost"); |
| 802 |
0
|
Trace.paramInfo(CLASS, this, method, "last match ", matchingBegin); |
| 803 |
0
|
Trace.paramInfo(CLASS, this, method, "current context", context); |
| 804 |
0
|
Trace.paramInfo(CLASS, this, method, |
| 805 |
|
"find context ", find.getLocationWithinModule()); |
| 806 |
|
|
| 807 |
|
|
| 808 |
|
|
| 809 |
0
|
Trace.traceStack(CLASS, this, method); |
| 810 |
0
|
Trace.info(CLASS, this, method, "changing XPath to last matching one"); |
| 811 |
|
|
| 812 |
|
|
| 813 |
|
|
| 814 |
0
|
current = matchingPath; |
| 815 |
0
|
throw new LocationFoundException(new ModuleContext(find.getModuleLocation(), |
| 816 |
|
matchingBegin)); |
| 817 |
|
} |
| 818 |
|
} |
| 819 |
612335
|
traverser.setBlocked(true); |
| 820 |
|
} |
| 821 |
961041
|
checkIfFound(); |
| 822 |
|
} |
| 823 |
|
|
| 824 |
|
|
| 825 |
|
|
| 826 |
|
|
| 827 |
|
@param |
| 828 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 829 |
919109
|
private final void enter(final String element) {... |
| 830 |
919109
|
level++; |
| 831 |
919109
|
current.addElement(element, addOccurence(element)); |
| 832 |
|
} |
| 833 |
|
|
| 834 |
|
|
| 835 |
|
|
| 836 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 837 |
615675
|
private final void leave() {... |
| 838 |
615675
|
level--; |
| 839 |
615675
|
current.deleteLastElement(); |
| 840 |
615675
|
traverser.setBlocked(false); |
| 841 |
|
} |
| 842 |
|
|
| 843 |
|
|
| 844 |
|
|
| 845 |
|
|
| 846 |
|
|
| 847 |
|
|
| 848 |
|
|
| 849 |
|
|
| 850 |
|
@param |
| 851 |
|
@return |
| 852 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (18) |
Complexity: 4 |
Complexity Density: 0.33 |
|
| 853 |
919109
|
private final int addOccurence(final String name) {... |
| 854 |
919239
|
while (level < elements.size()) { |
| 855 |
130
|
elements.remove(elements.size() - 1); |
| 856 |
|
} |
| 857 |
1222870
|
while (level > elements.size()) { |
| 858 |
303761
|
elements.add(new HashMap()); |
| 859 |
|
} |
| 860 |
919109
|
final Map levelMap = (Map) elements.get(level - 1); |
| 861 |
919109
|
final Enumerator counter; |
| 862 |
919109
|
if (levelMap.containsKey(name)) { |
| 863 |
367420
|
counter = (Enumerator) levelMap.get(name); |
| 864 |
367420
|
counter.increaseNumber(); |
| 865 |
|
} else { |
| 866 |
551689
|
counter = new Enumerator(1); |
| 867 |
551689
|
levelMap.put(name, counter); |
| 868 |
|
} |
| 869 |
919109
|
return counter.getNumber(); |
| 870 |
|
} |
| 871 |
|
|
| 872 |
|
} |