- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 156
 
Manipulating classpath items should preserve item order #865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 
           Hey buddy !  | 
    
| 
           hello stephane ! I'm on vacation too ! There is no hurry I will have to wait for a release before I put this in james build anyway :D enjoy your rest :D  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a TreeSet feels very weird to me. TreeSet sorts by default with natural order, which I’m not even sure what it means for Files. It doesn’t conserve first insertion order.
What you want is a LinkedHashSet.
Lack of unit tests.
| 
           Sorry about that you are perfectly right. I changed the implementation to use a   | 
    
`getClasspathElements` computes the compilation and test compilation classpath from `MavenProject#getCompileClasspathElements` which is a `List<String>`. Transforming from the ordered `List<String>` into an unordered `Hashset<File>` can change the order of classpath elements. While this didn't cause a compilation issue in my case it could. It did break the [develocity cache key computation](https://develocity.apache.org/c/unuozmm6ecqpc/nusnauq3l6a6u/goal-inputs?expanded=WyJuemRibm96bGFrZ2FnLWNsYXNzcGF0aGVsZW1lbnRzIiwibnpkYm5vemxha2dhZy1jbGFzc3BhdGhFbGVtZW50cy0wLWZpbGUtb3JkZXIiXQ) I'm using to improve Apache James build times.
| 
           Hey @jeantil 4.9.6 is out with your fix. Sorry for the delay.  | 
    
| 
           Thank you for letting me know ! the delay is perfectly normal :D  | 
    
ScalaCompileMojo#getClasspathElementsandScalaTestCompileMojo#getClasspathElementscompute the compilation and test compilation classpath fromMavenProject#getCompileClasspathElementswhich is aList<String>.Transforming from the ordered
List<String>into an unorderedHashset<File>can change the order of classpath elements.In my specific case, it broke the develocity cache key computation I'm using to improve Apache James build times.
In other cases it could lead to incorrect compilation or compilation errors ..