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

Make LogSequenceNumber implement Comparable<LogSequenceNumber> #1494

Merged
merged 3 commits into from Jun 6, 2019
Merged

Make LogSequenceNumber implement Comparable<LogSequenceNumber> #1494

merged 3 commits into from Jun 6, 2019

Conversation

@maltalex
Copy link
Contributor

@maltalex maltalex commented Jun 3, 2019

Regarding #1493:

added a Java 6 - compatible compareTo implementation for LogSequenceNumber, so it implements Comparable<LogSequenceNumber>.

@AppVeyorBot
Copy link

@AppVeyorBot AppVeyorBot commented Jun 3, 2019

@codecov-io
Copy link

@codecov-io codecov-io commented Jun 3, 2019

Codecov Report

Merging #1494 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##             master    #1494      +/-   ##
============================================
+ Coverage      68.8%   68.82%   +0.01%     
- Complexity     3930     3933       +3     
============================================
  Files           179      179              
  Lines         16458    16461       +3     
  Branches       2672     2673       +1     
============================================
+ Hits          11324    11329       +5     
+ Misses         3889     3887       -2     
  Partials       1245     1245

@AppVeyorBot
Copy link

@AppVeyorBot AppVeyorBot commented Jun 3, 2019

jorsol
jorsol approved these changes Jun 6, 2019
@davecramer
Copy link
Member

@davecramer davecramer commented Jun 6, 2019

@maltalex I think it would be useful to attempt to prove that our unsigned comparison works. Not that I am doubting that it works, just that if the code is there we should test it.

@maltalex
Copy link
Contributor Author

@maltalex maltalex commented Jun 6, 2019

@davecramer Sure, I can add more tests. Do you have a specific test in mind? I feel like I covered basic comparisons as well as the edge cases like comparing a "positive" with a "negative", comparing two "negatives" etc.

Would you like to see something like a comparison of every pair of numbers from a pre-generated sorted list of numbers?

@davecramer
Copy link
Member

@davecramer davecramer commented Jun 6, 2019

@maltalex whoops sorry I missed the negative case when I first looked

@davecramer davecramer merged commit 1970c4a into pgjdbc:master Jun 6, 2019
3 checks passed
davecramer added a commit to davecramer/pgjdbc that referenced this issue Jul 5, 2021
…c#1494)

* LogSequenceNumber now implements Comparable<LogSequenceNumber>

* LogSequenceNumber compareTo tests

* LogSequenceNumber and LogSequenceNumberTest codestyle fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants