-
Notifications
You must be signed in to change notification settings - Fork 49
Support fallback constructor/parameter selection #309
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5260018
Support fallback constructor/parameter selection
oschwald 4278ea7
Decode int primitive constructor params
oschwald dcb961c
Defaults for missing constructor params via annotation
oschwald 88c3ecd
Add lookup context injection annotations
oschwald 90d18b4
Drop DatabaseRecord InetAddress constructor
oschwald d746dad
Handle nested context-only constructors
oschwald 8ffb95a
Add @MaxMindDbCreator annotation for custom deserialization
oschwald d6c7e61
Publish snapshot release
oschwald 8944a97
Remove outdated distributionManagement section
oschwald b1349a5
Fix OOM error when reading from InputStream
oschwald 5f3ac3b
Replace legacy collections with modern alternatives
oschwald d881a49
Use Integer.MIN_VALUE in coerceFromLong range check
oschwald c20e678
Add type coercion support for UINT64/UINT128
oschwald 1d28478
Optimize UINT64/UINT128 decoding to avoid BigInteger allocation
oschwald File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||||||||||
| package com.maxmind.db; | ||||||||||||||
|
|
||||||||||||||
| import com.maxmind.db.Reader.FileMode; | ||||||||||||||
| import java.io.ByteArrayOutputStream; | ||||||||||||||
| import java.io.File; | ||||||||||||||
| import java.io.IOException; | ||||||||||||||
| import java.io.InputStream; | ||||||||||||||
|
|
@@ -13,6 +14,10 @@ final class BufferHolder { | |||||||||||||
| // DO NOT PASS OUTSIDE THIS CLASS. Doing so will remove thread safety. | ||||||||||||||
| private final Buffer buffer; | ||||||||||||||
|
|
||||||||||||||
| // Reasonable I/O buffer size for reading from InputStream. | ||||||||||||||
| // This is separate from chunk size which determines MultiBuffer chunk allocation. | ||||||||||||||
| private static final int IO_BUFFER_SIZE = 16 * 1024; // 16KB | ||||||||||||||
|
Comment on lines
+17
to
+19
|
||||||||||||||
| // Reasonable I/O buffer size for reading from InputStream. | |
| // This is separate from chunk size which determines MultiBuffer chunk allocation. | |
| private static final int IO_BUFFER_SIZE = 16 * 1024; // 16KB | |
| // Reasonable I/O buffer size (16KB) for reading from InputStream. | |
| // This is separate from chunkSize which determines MultiBuffer chunk allocation. | |
| private static final int IO_BUFFER_SIZE = 16 * 1024; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package com.maxmind.db; | ||
|
|
||
| import java.lang.reflect.Method; | ||
|
|
||
| /** | ||
| * Cached creator method information for efficient deserialization. | ||
| * A creator method is a static factory method annotated with {@link MaxMindDbCreator} | ||
| * that converts a decoded value to the target type. | ||
| * | ||
| * @param method the static factory method annotated with {@link MaxMindDbCreator} | ||
| * @param parameterType the parameter type accepted by the creator method | ||
| */ | ||
| record CachedCreator( | ||
| Method method, | ||
| Class<?> parameterType | ||
| ) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 distributionManagement section was removed. If this repository still needs to publish artifacts to Maven Central or other repositories, this removal could break the release process. Verify that artifact distribution is handled elsewhere or restore this configuration if needed.