@@ -330,11 +330,15 @@ predicate hasExternalSpecification(Function f) {
330
330
}
331
331
332
332
private predicate parseField ( AccessPathToken c , DataFlow:: FieldContent f ) {
333
- exists ( string fieldRegex , string package , string className , string fieldName |
334
- fieldRegex = "^Field\\[(.*)\\.([^.]+)\\.([^.]+)\\]$" and
335
- package = c .regexpCapture ( fieldRegex , 1 ) and
336
- className = c .regexpCapture ( fieldRegex , 2 ) and
337
- fieldName = c .regexpCapture ( fieldRegex , 3 ) and
333
+ exists (
334
+ string fieldRegex , string qualifiedName , string package , string className , string fieldName
335
+ |
336
+ c .getName ( ) = "Field" and
337
+ qualifiedName = c .getAnArgument ( ) and
338
+ fieldRegex = "^(.*)\\.([^.]+)\\.([^.]+)$" and
339
+ package = qualifiedName .regexpCapture ( fieldRegex , 1 ) and
340
+ className = qualifiedName .regexpCapture ( fieldRegex , 2 ) and
341
+ fieldName = qualifiedName .regexpCapture ( fieldRegex , 3 ) and
338
342
f .getField ( ) .hasQualifiedName ( package , className , fieldName )
339
343
)
340
344
}
@@ -351,11 +355,12 @@ class SyntheticField extends string {
351
355
}
352
356
353
357
private predicate parseSynthField ( AccessPathToken c , string f ) {
354
- c .regexpCapture ( "SyntheticField\\[([.a-zA-Z0-9]+)\\]" , 1 ) = f
358
+ c .getName ( ) = "SyntheticField" and
359
+ f = c .getAnArgument ( )
355
360
}
356
361
357
362
/** Holds if the specification component parses as a `Content`. */
358
- predicate parseContent ( string component , DataFlow:: Content content ) {
363
+ predicate parseContent ( AccessPathToken component , DataFlow:: Content content ) {
359
364
parseField ( component , content )
360
365
or
361
366
parseSynthField ( component , content .( DataFlow:: SyntheticFieldContent ) .getField ( ) )
0 commit comments