You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Andrey Gura (JIRA)" <ji...@apache.org> on 2019/06/07 13:19:00 UTC

[jira] [Comment Edited] (IGNITE-11899) Fix code style violation

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

Andrey Gura edited comment on IGNITE-11899 at 6/7/19 1:18 PM:
--------------------------------------------------------------

[~Mmuzaf] Just took a quick look at your change. The first, thanks a lot for care about code style. 
I want to comment some things that should be fixed also. Notice that my comments addressed to the code author not to you. 

1. Using one-line Javadoc for class fields.

{code:java}
     /**
      *
     */
    private static final int PAGE_ID_OFFSET = 0;
{code}

Can be replaced by

{code:java}
     /** */
    private static final int PAGE_ID_OFFSET = 0;
{code}

Moreover, empty Javadoc comment it's very bad practice, so I believe that all comments like this should be replaced by meaningful comment. 

2. Magic numbers in some file should be replaced by constants with self-descriptive names.

Just an example:

{code:java}
MemoryCalculator(){
    onHeapAllocated(16 + (8 + 16) * 2);
}
{code}

I believe that this arithmetic expression can be rewritten in more clear manner.


was (Author: agura):
[~Mmuzaf] Just took a quick look at your change. The first, thanks a lot for care about code style. 
I want to comment some things that should be fixed also. Notice that my comments addressed to the code author not to you. 

1. Using one-line Javadoc for class fields.

{code:java}
     /**
     *
     */
    private static final int PAGE_ID_OFFSET = 0;
{code}

Can be replaced by

{code:java}
     /** */
    private static final int PAGE_ID_OFFSET = 0;
{code}

Moreover, empty Javadoc comment it's very bad practice, so I believe that all comments like this should be replaced by meaningful comment. 

2. Magic numbers in some file should be replaced by constants with self-descriptive names.

Just an example:

{code:java}
MemoryCalculator(){
    onHeapAllocated(16 + (8 + 16) * 2);
}
{code}

I believe that this arithmetic expression can be rewritten in more clear manner.

> Fix code style violation
> ------------------------
>
>                 Key: IGNITE-11899
>                 URL: https://issues.apache.org/jira/browse/IGNITE-11899
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Maxim Muzafarov
>            Assignee: Maxim Muzafarov
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> All the code style issues must be fixed, see the sample below.
> {code}
> [09:38:03]	[Step 2/2] [ERROR] /opt/buildagent/work/69588afcb2ab3382/modules/core/src/main/java/org/apache/ignite/internal/commandline/diagnostic/PageLocksCommand.java:50: 'VARIABLE_DEF' should be separated from previous statement. [EmptyLineSeparator]
> [09:38:03]	[Step 2/2] [ERROR] /opt/buildagent/work/69588afcb2ab3382/modules/core/src/main/java/org/apache/ignite/internal/commandline/diagnostic/PageLocksCommand.java:183: 'VARIABLE_DEF' should be separated from previous statement. [EmptyLineSeparator]
> [09:38:03]	[Step 2/2] [ERROR] /opt/buildagent/work/69588afcb2ab3382/modules/core/src/main/java/org/apache/ignite/internal/commandline/diagnostic/PageLocksCommand.java:187: 'VARIABLE_DEF' should be separated from previous statement. [EmptyLineSeparator]
> [09:38:03]	[Step 2/2] [ERROR] /opt/buildagent/work/69588afcb2ab3382/modules/core/src/main/java/org/apache/ignite/internal/commandline/diagnostic/PageLocksCommand.java:191: 'VARIABLE_DEF' should be separated from previous statement. [EmptyLineSeparator]
> {code}
> TC log:
> https://ci.ignite.apache.org/viewLog.html?buildId=4062737&buildTypeId=IgniteTests24Java8_CheckCodeStyle&tab=buildLog&branch_IgniteTests24Java8=%3Cdefault%3E



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)