New Rule Idea: locked field should not be public nor internal nor protected internal #6804
Labels
Area: C#
C# rules related issues.
Area: VB.NET
VB.NET rules related issues.
Type: Rule Idea
Idea for a rule that has NOT been specified.
What
When a
lock
statement is on a field, the field should not bepublic
internal
protected internal
How
private
:private protected
,protected
are also considered acceptable, because exposing fields to derived classes, in the same assembly or not, could be a valid approach when the synchronization should happen between methods of the base classes and methods of the derived class.file
accessibility should be considered as acceptable for locking, because of the fairly limited scope.Background
The text was updated successfully, but these errors were encountered: