Skip to content

Commit 5174662

Browse files
committed
C#: Address review comments.
1 parent 4ef866b commit 5174662

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

csharp/ql/src/Likely Bugs/StaticFieldWrittenByInstance.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ where
1919
fw.getTarget() = f and
2020
f.isStatic() and
2121
c = fw.getEnclosingCallable() and
22-
not exists(Member m | m = c or m = c.(Accessor).getDeclaration() | m.isStatic()) and
22+
not [c.(Member), c.(Accessor).getDeclaration()].isStatic() and
2323
f.getDeclaringType() = c.getDeclaringType() and
2424
c.fromSource()
25-
select fw.(VariableAccess), "Write to static field from instance method, property or constructor."
25+
select fw.(VariableAccess), "Write to static field from instance method, property, or constructor."
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| StaticFieldWrittenByInstance.cs:15:9:15:19 | access to field staticField | Write to static field from instance method, property or constructor. |
2-
| StaticFieldWrittenByInstance.cs:26:9:26:19 | access to field staticField | Write to static field from instance method, property or constructor. |
3-
| StaticFieldWrittenByInstance.cs:43:37:43:48 | access to field backingField | Write to static field from instance method, property or constructor. |
1+
| StaticFieldWrittenByInstance.cs:15:9:15:19 | access to field staticField | Write to static field from instance method, property, or constructor. |
2+
| StaticFieldWrittenByInstance.cs:26:9:26:19 | access to field staticField | Write to static field from instance method, property, or constructor. |
3+
| StaticFieldWrittenByInstance.cs:43:37:43:48 | access to field backingField | Write to static field from instance method, property, or constructor. |

0 commit comments

Comments
 (0)