-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Java cleanup #3929
Java cleanup #3929
Conversation
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.
Looks good overall. Have a couple suggestions.
List<FingerprintFacet> r = new ArrayList<FingerprintFacet>(getFacets()); | ||
Collections.sort(r,new Comparator<FingerprintFacet>() { | ||
List<FingerprintFacet> r = new ArrayList<>(getFacets()); | ||
r.sort(new Comparator<FingerprintFacet>() { |
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.
Seems like you can likely use Comparator.comparingLong(FingerprintFacet::getTimestamp)
instead of the manually written one.
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.
It looks like that happens often in jenkins, I might go back and add a commit later which does that cleanup:
return o1.getClass().getName().compareTo(o2.getClass().getName()); |
return o1.getDisplayName().compareTo(o2.getDisplayName()); |
return j1.getString("name").compareTo(j2.getString("name")); |
https://stackoverflow.com/questions/32995559/reverse-a-comparator-in-java-8 suggests Comparator.reverseOrder()
might be able to handle:
return -o1.compareTo(o2); |
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.
Figures because this feature was added in Java 8, and you're the main person making Java 8 related updated to Jenkins at the moment. ;)
78fc57d
to
886e350
Compare
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.
Really hard to review such amount of changes. In my opinion you should split this kind of PR into several ones.
@@ -3403,9 +3403,6 @@ public void onAttained(Milestone milestone) { | |||
LOGGER.log(lv, s); | |||
} | |||
}); | |||
} catch (InterruptedException | ReactorException | IOException e) { |
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.
Why is this removed?
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.
The short answer is "because the computer did it". A longer answer is that those exceptions don't apply there.
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.
I guess it's fine since they are not runtime ones.
Let's consider this ready I think. |
@batmat: resolved... |
Let's wait for a green PR build and we merge. Because looking at the associated CI, I currently see only red builds BUT all seems either related to the now fixed conflicts, or an infra issue. I'll check more deeply after it completes: I also just updated the changelog proposal... |
All 💚, merging. |
This is for discussion.
Notes:
Proposed changelog entries
Internal:
Internal Java code cleanupSubmitter checklist
* Use the
Internal:
prefix if the change has no user-visible impact (API, test frameworks, etc.)Desired reviewers