dlmarion commented on code in PR #65:
URL: https://github.com/apache/accumulo-access/pull/65#discussion_r1499828063
##########
src/main/java/org/apache/accumulo/access/Authorizations.java:
##########
@@ -58,9 +59,12 @@ public int hashCode() {
return authorizations.hashCode();
}
+ /**
+ * @return a String containing the sorted, comma-separated set of
authorizations
+ */
@Override
public String toString() {
- return authorizations.toString();
+ return new TreeSet<>(authorizations).toString();
Review Comment:
I wonder what the penalty is here when the user doesn't care about sorting?
Consider the example:
```
LOG.info("Authorizations: {}", authorizations);
```
I wonder if we should leave `toString()` the way that it was, and add a new
method with this implementation called `toSortedString` or something. i'm
usually on the fence regarding changes like this because we are baking in a
performance penalty 100% of the time for something that we *think* is a good
idea. I'd rather let the user choose if they want that penalty.
--
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]