You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "Christopher Tubbs (JIRA)" <ji...@apache.org> on 2013/04/30 05:12:15 UTC

[jira] [Commented] (ACCUMULO-1361) VisibilityEvaluator throws NPE when passed a zero length byte array

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

Christopher Tubbs commented on ACCUMULO-1361:
---------------------------------------------

It should be noted that the VisibilityFilter handles this case. If the visibility expression is empty, it falls back on the server-configured default visibility "table.security.scan.visibility.default". If that is empty, then the filter immediately returns true.

This ticket only addresses the issue where one would want to use the VisibilityEvaluator external to Accumulo. While we can add this feature to support that case, it's not a bug in Accumulo. It's not even something we'd use if we did add it, because to use it, we'd have to create objects in the iterator stack, and performance would be lower (it's must faster to check the length of the visibility expression and default visibility than construct a ColumnVisibility with an empty visibility, only to return true every time).

                
> VisibilityEvaluator throws NPE when passed a zero length byte array
> -------------------------------------------------------------------
>
>                 Key: ACCUMULO-1361
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-1361
>             Project: Accumulo
>          Issue Type: Bug
>            Reporter: Chris McCubbin
>            Assignee: Corey J. Nolet
>            Priority: Minor
>             Fix For: 1.6.0
>
>         Attachments: ACCUMULO-1361.1.patch
>
>
> The following code snippet throws a NPE on a fairly recent version of 1.5. I would expect it to return true, or at the very least, to throw a meaningful exception.
> {code:title=SadPanda.java|borderStyle=solid}
> VisibilityEvaluator evaluator = new VisibilityEvaluator(new Authorizations("a".getBytes()));
> ColumnVisibility cv = new ColumnVisibility(new byte[0]);
> //The following line throws a NPE
> boolean result = evaluator.evaluate(cv);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira