hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maytee Chinavanichkit (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-18921) Result.current() throws ArrayIndexOutOfBoundsException after calling advance()
Date Tue, 03 Oct 2017 07:50:00 GMT

    [ https://issues.apache.org/jira/browse/HBASE-18921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16189372#comment-16189372

Maytee Chinavanichkit commented on HBASE-18921:

We can certainly do that. However what struck me as odd was that {{current()}} method throws
an exception. IMHO {{current()}} is like a {{get}} call and should simply return the value
under the cursor or null and should never throw exceptions. Instead, the {{advance()}} call
should handle the exceptional cases. For example, calling {{advance()}} after it has already
returned false should throw {{NoSuchElementException}}. 

> Result.current() throws ArrayIndexOutOfBoundsException after calling advance()
> ------------------------------------------------------------------------------
>                 Key: HBASE-18921
>                 URL: https://issues.apache.org/jira/browse/HBASE-18921
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Maytee Chinavanichkit
>            Priority: Minor
>         Attachments: master.patch
> On a Result object, if current() method is called after advance() returns false, this
throws an ArrayIndexOutOfBoundsException. The expectation here is that it should return a
null value. 

This message was sent by Atlassian JIRA

View raw message