Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7BFA5109F2 for ; Mon, 2 Dec 2013 08:59:44 +0000 (UTC) Received: (qmail 76161 invoked by uid 500); 2 Dec 2013 08:59:40 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 76018 invoked by uid 500); 2 Dec 2013 08:59:38 -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 75843 invoked by uid 99); 2 Dec 2013 08:59:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Dec 2013 08:59:35 +0000 Date: Mon, 2 Dec 2013 08:59:35 +0000 (UTC) From: "cuijianwei (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-10064) AggregateClient.validateParameters will throw NullPointerException when set startRow/stopRow of scan to null MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-10064?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] cuijianwei updated HBASE-10064: ------------------------------- Status: Patch Available (was: Open) > AggregateClient.validateParameters will throw NullPointerException when s= et startRow/stopRow of scan to null > -------------------------------------------------------------------------= ----------------------------------- > > Key: HBASE-10064 > URL: https://issues.apache.org/jira/browse/HBASE-10064 > Project: HBase > Issue Type: Bug > Components: Client > Affects Versions: 0.94.14 > Reporter: cuijianwei > > When using methods such as max(...), min(...) in AggregationClient=EF=BC= =8C we will pass Scan as parameter. These methods will throw NullPointerExc= eption if users invoke scan.setStartRow(null) or scan.setStopRow(null) befo= re passing the scan as parameter. The NullPointerException is thrown by va= lidateParameters(Scan scan) which will be invoked before sending requests = to server. The implementation of validateParameters is : > {code} > private void validateParameters(Scan scan) throws IOException { > if (scan =3D=3D null > || (Bytes.equals(scan.getStartRow(), scan.getStopRow()) && !Bytes > .equals(scan.getStartRow(), HConstants.EMPTY_START_ROW)) > || ((Bytes.compareTo(scan.getStartRow(), scan.getStopRow()) > 0) = && > =09!Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW))) { > throw new IOException( > "Agg client Exception: Startrow should be smaller than Stoprow"= ); > } else if (scan.getFamilyMap().size() !=3D 1) { > throw new IOException("There must be only one family."); > } > } > {code} > =E2=80=9CBytes.equals(scan.getStartRow(), HConstants.EMPTY_START_ROW)=E2= =80=9D will throw NullPointerException if the startRow of scan is set to nu= ll. -- This message was sent by Atlassian JIRA (v6.1#6144)