-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add support for longintmap #14
Conversation
sarveswaran-m
commented
Oct 12, 2023
- Adds support for LongIntMap
@sarveswaran-m please add tests :) |
10c0452
to
3f1f844
Compare
@mchernyakov Have added tests. Pls have a look |
somehow we missed that there is already a PR about longint map #6 |
build.gradle
Outdated
@@ -50,8 +55,8 @@ mavenPublishing { | |||
} | |||
} | |||
|
|||
sourceCompatibility = 11 | |||
targetCompatibility = 11 | |||
sourceCompatibility = 17 |
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.
probably we should add in the readme that the lib uses java 17
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.
- On further thought, it is better not to bump up source/target compatibility, since no jdk 17 specific feature is used in the lib. It would only prevent applications written in jdk versions < 17 from using the lib. Reverted this
* test cases have to be repeated for each typed map interface. | ||
*/ | ||
public abstract class AbstractMapTest { | ||
protected final Random random = ThreadLocalRandom.current(); |
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.
If you do that way, you use Random
related to a thread that instantiates a class.
I would rather use ThreadLocalRandom.current()
in a method.
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.
- Good point. Made
ThreadLocalRandom.current()
to be invoked at method level.
private LongIntMap map; | ||
// Keep the default value to easily verify that this value is returned. | ||
protected int defaultValue; | ||
// Some methods return the default value of the underlying Fastutil implementation. | ||
private static final int FASTUTIL_DEFAULT_VALUE = 0; |
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.
a const should go on top
private LongIntMap map; | |
// Keep the default value to easily verify that this value is returned. | |
protected int defaultValue; | |
// Some methods return the default value of the underlying Fastutil implementation. | |
private static final int FASTUTIL_DEFAULT_VALUE = 0; | |
// Some methods return the default value of the underlying Fastutil implementation. | |
private static final int FASTUTIL_DEFAULT_VALUE = 0; | |
private LongIntMap map; | |
// Keep the default value to easily verify that this value is returned. | |
protected int defaultValue; |
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.
- Done
Noticed it a bit too late :( |
ok, then you should close the old PR. Also, do not forget to update the version if you plan to release. |
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.
Changes LGTM but project version needs to be updated to prepare for the next release. Also version update in the README as well.
@sarveswaran-m @erdoganf the version should be 0.3.0! |