NightOwl888 opened a new issue, #663:
URL: https://github.com/apache/lucenenet/issues/663

   
https://sonarcloud.io/project/issues?resolved=false&types=CODE_SMELL&id=nikcio_lucenenet&open=AYPAuPfOhbfJOGLOobHM
   
https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
   
   Members that do not access instance data or call instance methods can be 
marked static. This may diverge from the Java implementation, so we should mark 
these members with the comment `// LUCENENET: CA1822: Mark members as static`.
   
   A check should be made against the Lucene source code first before applying 
this change. If there is no `final` modifier on a method in Java...
   
   ```java
   public void DoSomething() {
      // impl
   }
   ```
   
   ...it means it should be declared `virtual` in .NET.
   
   ```c#
   public virtual void DoSomething()
   {
      // impl
   }
   ```
   
   In this case, we cannot declare the method/property `static` and instead add 
the missing `virtual` modifier.
   
   > `**NOTE:** The entire codebase has been manually reviewed already to catch 
the virtual/non-virtual declarations, however, since this review was manual, 
there may have been some that were missed.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to