Skip to content

Commit c12c2a5

Browse files
committed
C#: Update the model editor code to disregard properties in case both a getter and a setter is present.
1 parent 5323af3 commit c12c2a5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

csharp/ql/src/utils/modeleditor/ModelEditor.qll

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@ private import Telemetry.TestLibrary
99

1010
/** Holds if the given callable is not worth supporting. */
1111
private predicate isUninteresting(Callable c) {
12-
c.getDeclaringType() instanceof TestLibrary or
13-
c.(Constructor).isParameterless() or
12+
c.getDeclaringType() instanceof TestLibrary
13+
or
14+
c.(Constructor).isParameterless()
15+
or
1416
c.getDeclaringType() instanceof AnonymousClass
17+
or
18+
// The data flow library uses read/store steps for properties, so we don't need to model them,
19+
// if both a getter and a setter exist.
20+
exists(Property p | p = c.(Accessor).getDeclaration() |
21+
exists(p.getSetter()) and exists(p.getGetter())
22+
)
1523
}
1624

1725
/**

0 commit comments

Comments
 (0)