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

BELUGA BEHR commented on HADOOP-15836:
--------------------------------------

[~elgoiri] Good eyes.  All things equal, I'd prefer a {{HashSet}}, however, the 
unit tests are written in such a way that they care about the order of the user 
and group names.  The unit tests are written in such a way that they just so 
happen to pass given today's implementation of a {{HashSet}} in the JDK.  
However, these assumptions on order makes the tests very brittle and would 
possibly fail with a JDK upgrade in which the order was changed based on a 
change in the HashSet implementation.  Since the unit tests are expecting a 
certain order to be enforced, I used a {{TreeSet}} which keeps the keys in 
order explicitly, no matter future changes to the JDK.

> Review of AccessControlList.java
> --------------------------------
>
>                 Key: HADOOP-15836
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15836
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: common, security
>    Affects Versions: 3.2.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Minor
>         Attachments: HADOOP-15836.1.patch
>
>
> * Improve unit tests (expected / actual were backwards)
> * Unit test expected elements to be in order but the class's return 
> Collections were unordered
> * Formatting cleanup
> * Removed superfluous white space
> * Remove use of LinkedList
> * Removed superfluous code
> * Use {{unmodifiable}} Collections where JavaDoc states that caller must not 
> manipulate the data structure



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to