@@ -363,27 +363,30 @@ class DeviationRecord extends XmlElement {
363
363
result .getRelativePath ( ) = getAChild ( "paths" ) .getAChild ( "paths-entry" ) .getTextValue ( )
364
364
}
365
365
366
+ private string getADeviationPath0 ( ) {
367
+ if exists ( getPathAContainer ( ) )
368
+ then
369
+ // Use the path, which will be relative to this file, if specified
370
+ result = getPathAContainer ( ) .getRelativePath ( )
371
+ else (
372
+ // Otherwise, if no code identifier was supplied, it applies to the parent container of the
373
+ // file itself
374
+ not exists ( getCodeIdentifier ( ) ) and
375
+ result = this .getFile ( ) .getParentContainer ( ) .getRelativePath ( )
376
+ )
377
+ }
378
+
366
379
/** Gets a path to which this deviation applies. */
367
380
string getADeviationPath ( ) {
368
381
exists ( string res |
369
- if exists ( getPathAContainer ( ) )
370
- then
371
- // Use the path, which will be relative to this file, if specified
372
- res = getPathAContainer ( ) .getRelativePath ( )
373
- else (
374
- // Otherwise, if no code identifier was supplied, it applies to the parent container of the
375
- // file itself
376
- not exists ( getCodeIdentifier ( ) ) and
377
- res = this .getFile ( ) .getParentContainer ( ) .getRelativePath ( )
378
- )
379
- |
382
+ res = getADeviationPath0 ( ) and
380
383
if res = "" then result = "(root)" else result = res
381
384
)
382
385
}
383
386
384
387
cached
385
388
predicate isDeviated ( Query query , string deviationPath ) {
386
389
query = getQuery ( ) and
387
- deviationPath = getADeviationPath ( )
390
+ deviationPath = getADeviationPath0 ( )
388
391
}
389
392
}
0 commit comments