Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 67E0C200B7F for ; Tue, 2 Aug 2016 01:14:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 66A89160A6C; Mon, 1 Aug 2016 23:14:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BC8EA160AAB for ; Tue, 2 Aug 2016 01:14:21 +0200 (CEST) Received: (qmail 65935 invoked by uid 500); 1 Aug 2016 23:14:20 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 65769 invoked by uid 99); 1 Aug 2016 23:14:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2016 23:14:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 992EC2C0D66 for ; Mon, 1 Aug 2016 23:14:20 +0000 (UTC) Date: Mon, 1 Aug 2016 23:14:20 +0000 (UTC) From: "Andrew Purtell (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-16272) Overflow in ServerName's compareTo method MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 01 Aug 2016 23:14:22 -0000 [ https://issues.apache.org/jira/browse/HBASE-16272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15403014#comment-15403014 ] Andrew Purtell commented on HBASE-16272: ---------------------------------------- Let me make a new patch for 0.98 that brings in Long#compare as a new utility method. Coming shortly. > Overflow in ServerName's compareTo method > ----------------------------------------- > > Key: HBASE-16272 > URL: https://issues.apache.org/jira/browse/HBASE-16272 > Project: HBase > Issue Type: Bug > Components: hbase > Reporter: huaxiang sun > Assignee: huaxiang sun > Fix For: 2.0.0, 1.3.0, 1.4.0, 1.1.6, 1.2.3 > > Attachments: HBASE-16272-v001.patch > > > Looking at the ServerName's compareTo(), > https://github.com/apache/hbase/blob/master/hbase-common/src/main/java/org/apache/hadoop/hbase/ServerName.java#L303 > It converts the return int value by converting long to int like (int)(longValue), which could be incorrect when it overflows, need to replace it with Long.compareTo(a,b). > [~mbertozzi] found some others as well, such as > https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java#L990 -- This message was sent by Atlassian JIRA (v6.3.4#6332)