Skip to content
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

Merged
merged 5 commits into from
Aug 27, 2020

Conversation

aleksey-kurinov
Copy link
Contributor

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

@aleksey-kurinov
Copy link
Contributor Author

@anton-vinogradov , @agoncharuk for some reasons I can't add reviewers to this PR
test of PR run without possible blockers - https://mtcga.gridgain.com/pr.html?serverId=apache&suiteId=IgniteTests24Java8_RunAll&branchForTc=pull/8187/head&action=Latest
so please review 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(";",""));
Copy link
Contributor

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(";", "")))

@anton-vinogradov anton-vinogradov merged commit 81dd397 into apache:master Aug 27, 2020
kartiksomani pushed a commit to kartiksomani/ignite that referenced this pull request Sep 15, 2020
ymolochkov pushed a commit to ymolochkov/ignite that referenced this pull request Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants