icsharpcode/NRefactory — pull request #189 by luiscubal (2013-06-02 22:43:39+00:00)
Title: Code Issue (and fix) to detect lock(this) and [MethodImpl(MethodImplOptions.Synchronized)]

This is the first time I make a code issue from scratch and it's pretty complex, so I'd appreciate some feedback.

What the issue does is detect whenever `lock(this)` or `[MethodImpl(MethodImplOptions.Synchronized)]` is used.
The auto-fix action creates a new `object locker` field that's used instead of `lock(this)`/`MethodImpl`.
See the unit tests for some examples.

I have not tested this code issue with partial classes. Additionally, should any derived classes use `lock(this)` as well, the auto-fix will not correct that.
If `[MethodImpl(MethodImplOptions.Synchronized)]` is used for abstract methods or empty methods, it is removed and ignored.