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

Sean Busbey commented on ACCUMULO-1958:
---------------------------------------

I presume the non-range-checking version is for some performance reason?

Can we just

* add a non-public method that does what this current implementation does
* make the method with this signature do the range check then call the above 
new method
* update internal, performance-sensitive, already-checked-the-range code to 
call the new method

This maintains API compatibility for all versions that exist, prevents invalid 
ranges, and allows the existing internal use.

> Range constructor lacks key checks, should be non-public
> --------------------------------------------------------
>
>                 Key: ACCUMULO-1958
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-1958
>             Project: Accumulo
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: Bill Havanki
>             Fix For: 1.7.0
>
>
> This ticket pertains to the Range class constructor with the following 
> signature:
> {noformat}
> public Range(Key, Key, boolean, boolean, boolean, boolean)
> {noformat}
> The constructor does not check that the start key is before the end key, like 
> every other constructor in the class. Since the constructor is public, this 
> makes it possible for a caller to create invalid ranges.
> The constructor is used by other constructors that take in existing range 
> objects, where the key check has implicitly been done, and so it would make 
> sense to skip the check in this one, but then the constructor visibility 
> should be at least protected.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to