> On June 19, 2018, 10:05 a.m., Zsombor Gegesy wrote:
> > security-admin/src/test/java/org/apache/ranger/common/TestJSONUtil.java
> > Line 110 (original), 112 (patched)
> > <https://reviews.apache.org/r/67642/diff/1/?file=2042279#file2042279line113>
> >
> >     Order of the elements in a set is not defined, this test could brake 
> > intermittenly. Why not compare as sets? 
> >     Set<String> expectedSet = new HashSet(Arrays.asList("hive", "hdfs", 
> > "knox"));
> >     
> >     Set<String> actualSet = 
> > jsonUtil.writeJsonToJavaObject("[\"hdfs\",\"hive\",\"knox\"]", 
> > HashSet.class);
> 
> bhavik patel wrote:
>     We are passing the predefined json string to method  
> jsonUtil.writeJsonToJavaObject  which always result into fixed set having 
> same order of the elements.
>     
>     It should not be an issues.
>     However we can also compare using set as well.

Yes, it's a rare issue, the order of the items are VM dependent. I don't have 
access to more exotic JDK's - like an IBM JDK on Power - to test it. But I do 
know, that this order was changed between Java 6 and Java 7. Hopefully, they 
won't change it again, but we shouldnt take is as granted.


- Zsombor


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67642/#review204994
-----------------------------------------------------------


On June 19, 2018, 9:46 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67642/
> -----------------------------------------------------------
> 
> (Updated June 19, 2018, 9:46 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay 
> Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Selvamohan Neethiraj, 
> Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2132
>     https://issues.apache.org/jira/browse/RANGER-2132
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Fix Coverity Scan issue
> 
> 
> Diffs
> -----
> 
>   security-admin/src/test/java/org/apache/ranger/common/TestDateUtil.java 
> 8b7d34f 
>   security-admin/src/test/java/org/apache/ranger/common/TestJSONUtil.java 
> 0daf7f1 
>   security-admin/src/test/java/org/apache/ranger/common/TestServiceUtil.java 
> 90a93ae 
> 
> 
> Diff: https://reviews.apache.org/r/67642/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> bhavik patel
> 
>

Reply via email to