ctubbsii opened a new issue #1839:
URL: https://github.com/apache/accumulo/issues/1839


   **Describe the bug**
   One possible way to construct a new AccumuloClient is to initialize the 
client builder with a set of Properties, as in:
   ```java
   var properties = testCluster.getAdminUserClientProperties();
   AccumuloClient client = Accumulo.newClient().from(properties).as("testUser", 
"testUserPassword").build();
   ```
   The current implementation (in 2.0.0) of this `from(Properties)` method is 
to use the provided Properties object to store additional properties as 
subsequent builder methods are called while building the client. In the above 
example, the properties to store the client's username and password would be 
stored in the Properties argument, clobbering any pre-existing values. This is 
a problem, because the caller may wish to use the object used as an argument to 
this method in subsequent AccumuloClient builds.
   
   **Versions (OS, Maven, Java, and others, as appropriate):**
    - Affected version(s) of this project: 2.0.0
   
   **To Reproduce**
   See above example.
   
   **Expected behavior**
   The `properties` variable should remain unmodified after using it in an 
AccumuloClient builder.
   
   **Additional context**
   The fix is easy: simply copy all the contents of the Properties argument 
into a new Properties object inside the builder in the implementation of the 
`from(Properties)` method.


----------------------------------------------------------------
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.

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


Reply via email to