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

ASF GitHub Bot commented on YARN-7023:
--------------------------------------

GitHub user dosoft opened a pull request:

    https://github.com/apache/hadoop/pull/262

    YARN-7023: Fixed compareTo()

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dosoft/hadoop YARN-7023

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/hadoop/pull/262.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #262
    
----
commit 6f4b059cc9c26e909fcc1b678b85c4a0ec32a1cf
Author: Oleg Danilov <[email protected]>
Date:   2017-08-16T12:19:26Z

    YARN-7023: Fixed compareTo()

----


> Incorrect ReservationId.compareTo() implementation
> --------------------------------------------------
>
>                 Key: YARN-7023
>                 URL: https://issues.apache.org/jira/browse/YARN-7023
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Oleg Danilov
>            Priority: Minor
>
> Obviously this is a typo and the second getId() call should be rewritten as 
> 'other.getId()'
> +Lines 94-102+
> {code:java}
>   @Override
>   public int compareTo(ReservationId other) {
>     if (this.getClusterTimestamp() - other.getClusterTimestamp() == 0) {
>       return getId() > getId() ? 1 : getId() < getId() ? -1 : 0;
>     } else {
>       return this.getClusterTimestamp() > other.getClusterTimestamp() ? 1
>           : this.getClusterTimestamp() < other.getClusterTimestamp() ? -1 : 0;
>     }
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to