Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [che-dev] Static import

Constants with the same name and value should use static import
add(GET, "/request") does not require to have written add(HttpMethod.GET, "/request") as HttpMethod.GET = "GET"

Using Mocks in tests or assertions should also use static import on methods
doReturn(that).when(...)  
when(...)
assetEquals()

it improves readability of the code by omitting unnecessary stuff.

For the other cases, it can be developer's choice

Regards,

Florent



On Tue, Jun 30, 2015 at 3:48 PM, Sharafy, Tareq <tareq.sharafy@xxxxxxx> wrote:

Hi,

I vote #2 and trust the developers and the reviewers.

The pull request is a reasonable example of code without static imports.

thank you
Tareq Sharafy

From: che-dev-bounces@xxxxxxxxxxx [mailto:che-dev-bounces@xxxxxxxxxxx] On Behalf Of Sergii Kabashniuk
Sent: Tuesday 30 June 2015 16:17
To: che developer discussions
Subject: [che-dev] Static import

 

I would like to ask community for their opinion about static import.

Initial discussion was started from this PR  https://github.com/codenvy/che-core/pull/132 

 

It's made around this rule 

 

As for me currently I'm about 50/50 

Yes. sometimes it can cause some problems but generally it makes code shorter and more readable.

 

This check is not enabled in  Google or Sun checkstyle.

 

It's only available in very strict general checkstyle.

 

So I would say to vote we have 2 option.

 

1. We require not to use static import.

2. It's up to developer should he use it or not.

 

Sergii Kabashniuk

PS 
I vote 2 at this moment.


_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev



Back to the top