-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
IGNITE-13218 fixed. importComparator added to TreeSet to provide core… #8187
Conversation
@anton-vinogradov , @agoncharuk for some reasons I can't add reviewers to this PR |
@@ -148,7 +148,8 @@ public static void main(String[] args) throws Exception { | |||
*/ | |||
private <T> Collection<String> generate(Class<T> clazz) { | |||
final List<String> code = new ArrayList<>(); | |||
final Set<String> imports = new TreeSet<>(); | |||
Comparator<String> importComparatror = (s1, s2) -> s1.replace(";","").compareTo(s2.replace(";","")); |
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.
@aleksey-kurinov There is typo in the var name. There is no white space between parameters. (See CodingGuidelines)
I suggest to pass comparator to the constructor parameter:
new TreeSet<>(Comparator.comparing(s -> s.replace(";", "")))
apache#8187) (cherry picked from commit 81dd397)
imports order was incorrect because if default lexicographical comparator
"import org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState;" is less "import org.apache.ignite.spi.systemview.view.ComputeJobView;"
however if we remove semicolom uring comparing the problem is fixed
so to fix the problem I've added custom comparator to "imports" TreeSet