[ 
https://issues.apache.org/jira/browse/CASSANDRA-18089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17644169#comment-17644169
 ] 

Stefan Miklosovic commented on CASSANDRA-18089:
-----------------------------------------------

Hi [~mmuzaf]

I would like to see discussion thread about AvoidStarImport rule on the mailing 
list.

Because of the amount of the changes, it would be nice if we fix order of these 
imports as well in one run so we do not need to have two big patches instead of 
one. This is again something to discuss. Ideally one we do that we have nothing 
else to do when it comes to imports.

It is good thing that you dedicated a separate ticket for that, but in 
practical terms, I think that, if we decide to do so, committing their order 
would be nice as well.

> The source code must obey the avoid star import checkstyle rule
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-18089
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18089
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Build
>            Reporter: Maxim Muzafarov
>            Assignee: Maxim Muzafarov
>            Priority: Normal
>             Fix For: 4.x
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Cassandra has the code style rules regarding the classes import order: 
> [https://cassandra.apache.org/_/development/code_style.html]
> Importing all classes from a package or static members from a class leads to 
> tight coupling between packages or classes and might lead to problems when a 
> new library version introduces name clashes. The advantage of explicitly 
> listing all imports from a package is that you can tell at a glance which 
> class you meant to use, which does reading and refactoring the source code 
> that much easier.
> The checkstyle that is already used for checking the source code has a such 
> check and this check may be added to the config both for the production and 
> test source code:
> https://checkstyle.sourceforge.io/config_imports.html#AvoidStaticImport
> Besides adding a new checkstyle rule it may be more convenient for those 
> community members that are working with the code to reflect the same rule in 
> the IDE's inspection profiles (if it's possible), thus using the 'optimize 
> imports' will produce the same results on each execution as the checkstyle 
> does.
> Summary:
> - add new checkstyle rule;
> - update IDE's appropriate built-in inspections configurations;
> - update development code-style web page and wiki;



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to