You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/05/26 05:59:11 UTC

[GitHub] [incubator-doris] jackwener commented on issue #9775: [Enhancement] Remove the redundant `this.`

jackwener commented on issue #9775:
URL: https://github.com/apache/incubator-doris/issues/9775#issuecomment-1138183981

   > Hey @jackwener I am a beginner and never contributed to any open source. I want to work on this, can you help me with this issue.
   
   It's ok😀, let's me explain this issue.
   
   In Java, we can use `this.` to access `class member variables` like `if (this.name == jackwener)`. 
   
   But, in most scenario, it's redundant. just use in constructor like:
   
   ```java
   
   class Person {
       public string name;
       
       Person(name) {
           this.name = name;
       }
   
       boolean isJack() {
            this.name == "jack";  // It's redundant;
       }
   }
   ```
   
   So, we can remove the redundant like `isJack()`.
   
   example in #8862 `fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsJobManager.java`
   
   


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org