hsiangawang opened a new pull request #2740: URL: https://github.com/apache/hbase/pull/2740
The test `TestClassFinder#testClassFinderDefaultsToOwnPackage` compares two sets from `allClassesFinder.findClasses`. However, the function `allClassesFinder.findClasses` does not return the deterministic order result. From code trace, the root cause is at `ClassFinder.findClassesFromJar` and `ClassFinder.findClassesFromFiles`. They use `HashSet` to store `classes` and `listFiles` to get file array. However, `HashSet` and `listFiles` do not guarantee that order, and the assertion can fail if the order differs. The PR uses `LinkedHashSet` and sorts file array to make the order deterministic. ---------------------------------------------------------------- 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]
