-
Notifications
You must be signed in to change notification settings - Fork 739
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 checkExternalDecimal API #18272
Add checkExternalDecimal API #18272
Conversation
a07234f
to
1097dd7
Compare
7a0dfe2
to
53c606a
Compare
6a555f1
to
411fbe3
Compare
7ba8ffd
to
e3625f7
Compare
launched a personal build to test my changes |
The test build passed without any failures. adoptium/openj9-systemtest#152 (comment). @r30shah this is ready for review. |
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.
Can you add more information about this change in the Commit? Basically I would more information about checkExternalDecimal API and potential use cases.
* @param decimalType | ||
* constant indicating the type of the decimal | ||
* | ||
* @return the condition code: 0 if all digit codes and the sign valid, 1 if the sign is invalid, |
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.
Can you write the condition codes in separate line so it is easier to read?
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 have updated it in my latest commit.
if (precision < 1) | ||
throw new IllegalArgumentException("Illegal Precision."); | ||
|
||
if ((offset + (CommonData.getExternalByteCounts(precision, decimalType)) > byteArray.length) || (offset < 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.
In which case we can have offset less than zero ? Asking because, if caller can set the offset to negative and first check passes, we would not do second check. Just a question.
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.
Ah right, that should really be 2 separate checks. I have updated it in my latest commit.
@r30shah this is ready for an other review. |
21a91ef
to
e96fbe5
Compare
Launched personal build to verify changes. I'll remove WIP tag once I have verified the changes. |
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.
Minor cosmetic changes, Overall changes looks OK to me
* constant indicating the type of the decimal | ||
* | ||
* @return the condition code: | ||
* 0 if all digit codes and the sign valid, |
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.
* 0 if all digit codes and the sign valid, | |
* 0 if all digit codes and the sign are valid, |
* @return the condition code: | ||
* 0 if all digit codes and the sign valid, | ||
* 1 if the sign is invalid, | ||
* 2 if at least one digit code is invalid, and |
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 think , and
is not needed
* constant indicating the type of the decimal | ||
* | ||
* @return the condition code: | ||
* 0 if all digit codes and the sign valid, |
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.
Should we take advantage of final int like we are doing in Decimal data to make this more readable ?
1776ceb
to
81228e2
Compare
* @param precision | ||
* number of digits to be verified. | ||
* @param decimalType | ||
* constant indicating the type of the decimal. Supporte values are |
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.
typo here. Also as we are mentioning the constant from DecimalData, may be we should add that.
jcl/src/openj9.dataaccess/share/classes/com/ibm/dataaccess/ExternalDecimal.java
Show resolved
Hide resolved
@VermaSh What is the order for the changes to go? I would assume this API need to go first and than adoptium/openj9-systemtest#152 right ? |
81228e2
to
738d50f
Compare
Yup, this needs to go ahead of adoptium/openj9-systemtest#152. Also, I have updated the PR with your suggestions. |
Signed-off-by: Shubham Verma <[email protected]>
738d50f
to
f3da656
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.
LGTM
jenkins test sanity all jdk8,jdk11,jdk17 |
@VermaSh Can you verify the failures seen on x86 and aarch64? |
@r30shah x86 failures were criu related and arm failure was due to a time out. |
jenkins test sanity xlinux jdk11,jdk17 |
aarch64 |
jenkins test sanity alinux64 jdk17 |
Thanks @VermaSh for triaging these failures. I have launched last one that failed. Will merge the change once the build finishes. |
All test passes. Merging the changes for DAA API |
No description provided.