@@ -57,22 +57,30 @@ query string getAccessModifier(DataFlow::PropRef ref, Expr prop) {
5757 if ref .isPrivateField ( ) then result = "Private" else result = "Public"
5858}
5959
60- class Configuration extends DataFlow:: Configuration {
61- Configuration ( ) { this = "ClassDataFlowTestingConfig" }
62-
63- override predicate isSource ( DataFlow:: Node source ) {
60+ module TestConfig implements DataFlow:: ConfigSig {
61+ predicate isSource ( DataFlow:: Node source ) {
6462 source .getEnclosingExpr ( ) .( StringLiteral ) .getValue ( ) .toLowerCase ( ) = "source"
6563 }
6664
67- override predicate isSink ( DataFlow:: Node sink ) {
65+ predicate isSink ( DataFlow:: Node sink ) {
6866 any ( DataFlow:: CallNode call | call .getCalleeName ( ) = "sink" ) .getAnArgument ( ) = sink
6967 }
7068}
7169
72- query predicate dataflow ( DataFlow:: Node pred , DataFlow:: Node succ ) {
73- any ( Configuration c ) .hasFlow ( pred , succ )
70+ module TestFlow = DataFlow:: Global< TestConfig > ;
71+
72+ class LegacyConfig extends DataFlow:: Configuration {
73+ LegacyConfig ( ) { this = "LegacyConfig" }
74+
75+ override predicate isSource ( DataFlow:: Node source ) { TestConfig:: isSource ( source ) }
76+
77+ override predicate isSink ( DataFlow:: Node sink ) { TestConfig:: isSink ( sink ) }
7478}
7579
80+ import testUtilities.LegacyDataFlowDiff:: DataFlowDiff< TestFlow , LegacyConfig >
81+
82+ query predicate dataflow = TestFlow:: flow / 2 ;
83+
7684query BlockStmt staticInitializer ( ClassDefinition cd ) { result = cd .getAStaticInitializerBlock ( ) }
7785
7886query Identifier privateIdentifier ( ) { result .getName ( ) .matches ( "#%" ) }
0 commit comments