loganasherjones opened a new issue, #5372:
URL: https://github.com/apache/accumulo/issues/5372

   **Describe the bug**
   The user `VisibilityFilter` class will typically NPE if `deepCopy` is called 
after it has been initialized.
   
   **Versions (OS, Maven, Java, and others, as appropriate):**
    - Affected version(s) of this project: All
    - OS: N/A
    - Others: N/A
   
   **To Reproduce**
   
   The following unit test proves the problem
   
   ```java
   public void testDeepCopyAfterInit() throws IOException {
       IteratorSetting is = new IteratorSetting(1, VisibilityFilter.class);
       VisibilityFilter.setAuthorizations(is, new Authorizations("abc"));
       Map<String,String> opts = is.getOptions();
       Filter filter = new VisibilityFilter();
       TreeMap<Key,Value> source = new TreeMap<>();
       filter.init(new SortedMapIterator(source), opts, null);
       Filter copyFilter = (Filter) filter.deepCopy(null);
       Key k = new Key("row", "cf", "cq", "abc");
       assertTrue(copyFilter.accept(k, new Value()));
     }
   ```
   Running this test on 1.X/2.X/3.X will result in an NPE because `deepCopy` is 
not implemented for the `VisibilityFilter`.
   
   **Expected behavior**
   `copyFilter.accept(k, new Value());` should return `true`, not throw an NPE.
   
   **Additional context**
   
   I'll submit a PR momentarily to demonstrate a possible fix.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to