Open joachimmarder opened 3 years ago
@joachimmarder : I think this makes sense for virtual or override methods. However, I'm not sure about none-virtual methods (don't see a reason/usecase for empty none-virtual method)
However, I'm not sure about none-virtual methods
@Ajoschi: A method implementation can be required by an interface but in some cases there is no implementation that makes sense. Such methods can still be non-virtual.
In any case you could simply add an exit
statement to get rid of the warning.
...implementation can be required by an interface...
Right! Did not think about this use case. Thx @joachimmarder
Same rule for C# also accepts comments as non-empty method body: https://rules.sonarsource.com/csharp/RSPEC-1186
Often an empty method body is justified by a comment. In this case the
EmptyBeginStatementRule
should not match.