• Post Reply Bookmark Topic Watch Topic
  • New Topic

Check Style Rule : What should be the order of imports  RSS feed

 
hemant Budhewar BamniBk
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
when we use static imports,

Can anybody have idea why and in what order static imports should be placed?

This check style rule gives some option to select order of imports,

What is the better value for the property import order?

Refer this link for all those options,

http://checkstyle.sourceforge.net/property_types.html#importOrder

 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hemant:

I don't think it matters. Whichever way you like is probably the 'best'.

John.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compared to "normal" imports, static imports should be quite rare, so I'm not even sure if it makes sense to devote much thought on this.

Of course, I almost always avoid static imports, because I think code is easier to understand if static methods/fields are explicitly prefixed by their class. In this case, the convenience of the original developer is trumped by the need of subsequent developers to understand the code.
 
hemant Budhewar BamniBk
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John de Michele wrote:Hemant:

I don't think it matters. Whichever way you like is probably the 'best'.

John.


Thanks John for your opinion
 
hemant Budhewar BamniBk
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Compared to "normal" imports, static imports should be quite rare, so I'm not even sure if it makes sense to devote much thought on this.

Of course, I almost always avoid static imports, because I think code is easier to understand if static methods/fields are explicitly prefixed by their class. In this case, the convenience of the original developer is trumped by the need of subsequent developers to understand the code.


Ulf!, I do agree with you.

Another thing is that, each time we need to see static imports to know about static methods/fields unless using good IDE
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!