3pacccccc opened a new pull request, #25928:
URL: https://github.com/apache/pulsar/pull/25928

    ### Motivation                                                              
                                                                                
                                                                      
                                                                                
                                                                                
                                                                       
     While reading the project code, I noticed that many places use fully 
qualified class names directly in method bodies or field declarations, 
e.g:https://github.com/apache/pulsar/pull/25920.                                
                                                
                                                                                
                                                                                
                                                                       
     Using fully qualified class names in regular code can make the code harder 
to read and less consistent with normal Java style. This PR adds an explicit 
coding guideline so contributors prefer imports by default and only use   
     fully qualified names when they are needed to resolve naming conflicts.    
                                                                                
                                                                       
                                                                                
                                                                                
                                                                       
     ### Modifications                                                          
                                                                                
                                                                       
                                                                                
                                                                                
                                                                       
     Add a style guideline to `CODING.md`:                                      
                                                                                
                                                                       
                                                                                
                                                                                
                                                                       
     - Prefer imports over fully qualified class names in code.                 
                                                                                
                                                                       
     - Use a fully qualified class name only when needed to disambiguate a name 
collision that imports cannot resolve.                                          
                                                                       
                                                                                
                                                                                
                                                                       
     ### Verifying this change                                                  
                                                                                
                                                                       
                                                                                
                                                                                
                                                                       
     - [ ] Make sure that the change passes the CI checks.                      
                                                                                
                                                                       
                                                                                
                                                                                
                                                                       
     This change is a documentation-only coding guideline update without test 
coverage.                                                                       
                                                                         
                                                                                
                                                                                
                                                                       
     Locally verified with:                                                     
                                                                                
                                                                       
                                                                                
                                                                                
                                                                       
     ```bash                                                                    
                                                                                
                                                                       
     git diff --check -- CODING.md                                              
                                                                                
                                                                       
                                                                                
                                                                                
                                                                       
     ### Does this pull request potentially affect one of the following parts:  
                                                                                
                                                                       
                                                                                
                                                                                
                                                                       
     - [ ] Dependencies (add or upgrade a dependency)                           
                                                                                
                                                                       
     - [ ] The public API                                                       
                                                                                
                                                                       
     - [ ] The schema                                                           
                                                                                
                                                                       
     - [ ] The default values of configurations                                 
                                                                                
                                                                       
     - [ ] The threading model                                                  
                                                                                
                                                                       
     - [ ] The binary protocol                                                  
                                                                                
                                                                       
     - [ ] The REST endpoints                                                   
                                                                                
                                                                       
     - [ ] The admin CLI options                                                
                                                                                
                                                                       
     - [ ] The metrics                                                          
                                                                                
                                                                       
     - [ ] Anything that affects deployment                                     
                                                                                
                                                                       
                    


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to