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
8290775: Some doc errors in DerOutputStream.java #9585
Conversation
Hi @jquanC, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user jquanC" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
To avoid this situation, create a new branch for your changes and reset the
Then proceed to create a new pull request with |
Webrevs
|
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.
Thanks for the update. However, I have concerns about the update of parameter descriptions.
@@ -175,7 +175,7 @@ public void putInteger(BigInteger i) throws IOException { | |||
/** | |||
* Marshals a DER integer on the output stream. | |||
* | |||
* @param i the integer in bytes, equivalent to BigInteger::toByteArray. | |||
* @param buf buffered data, which must be DER-encoded |
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 information of the parameter, "the integer in bytes, equivalent to BigInteger::toByteArray", may be not necessary to be updated, which is right I think.
@@ -461,8 +461,8 @@ public void putGeneralString(String s) throws IOException { | |||
* @param s the string to write | |||
* @param stringTag one of the DER string tags that indicate which | |||
* encoding should be used to write the string out. | |||
* @param enc the name of the encoder that should be used corresponding | |||
* to the above tag. | |||
* @param charset the specified character set encodes a string into a |
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 it may be not necessary to update the parameter description.
Thanks for your careful check!
On the first point, I am not careful enough. As you said, there is no need to modify it cause it is quite clear at the end of the sentence.
On the second point, I have some doubts. 1) Here don't need to add ***@***.*** charset" because it's clear to everyone? ***@***.*** enc" does not seem to be used in the method. Shouldn't it be deleted?
Looking forward to your guidance. Thanks again!
…------------------ 原始邮件 ------------------
发件人: "openjdk/jdk" ***@***.***>;
发送时间: 2022年7月22日(星期五) 凌晨5:53
***@***.***>;
***@***.******@***.***>;
主题: Re: [openjdk/jdk] 8290775: Some doc errors in DerOutputStream.java (PR #9585)
@XueleiFan requested changes on this pull request.
Thanks for the update. However, I have concerns about the update os parameter descriptions.
In src/java.base/share/classes/sun/security/util/DerOutputStream.java:
> @@ -175,7 +175,7 @@ public void putInteger(BigInteger i) throws IOException { /** * Marshals a DER integer on the output stream. * - * @param i the integer in bytes, equivalent to BigInteger::toByteArray. + * @param buf buffered data, which must be DER-encoded
The information of the parameter, "the integer in bytes, equivalent to BigInteger::toByteArray", may be not necessary to be updated, which is right I think.
In src/java.base/share/classes/sun/security/util/DerOutputStream.java:
> @@ -461,8 +461,8 @@ public void putGeneralString(String s) throws IOException { * @param s the string to write * @param stringTag one of the DER string tags that indicate which * encoding should be used to write the string out. - * @param enc the name of the encoder that should be used corresponding - * to the above tag. + * @param charset the specified character set encodes a string into a
I think it may be not necessary to update the parameter description.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sorry for the confusing. I think it is fine to update the "param enc" to "param charset", but it may be not necessary to update the parameter description. With "parameter description", I refer to this part, "the name of the encoder that should be used corresponding to the above tag". The parameter description may be still confusing to someone, as the 'the name of the encoder' is not well-defined here. Maybe, it could be simplified as "the charset that ..." Here is the proposed update:
I may use an update like :
|
|
Thanks for your advice!
|
…ense problem of expression
@@ -461,8 +461,8 @@ public void putGeneralString(String s) throws IOException { | |||
* @param s the string to write | |||
* @param stringTag one of the DER string tags that indicate which | |||
* encoding should be used to write the string out. | |||
* @param enc the name of the encoder that should be used corresponding | |||
* to the above tag. | |||
* @param charset the charset should be used corresponding to the |
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 may suggest to add 'that' back. Without it, the meaning of the sentence may be different.
... the charset should be used corresponding to the above tag.
vs
... the charset **that** should be used corresponding to the above tag.
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.
Thanks again for all the above suggestions sincerely!
To avoid adding your troubles, I should end up using the following expression:
the charset that should be used corresponding to the above tag.
I'm trying to understand the difference between the two.
The first sentence may be understood as "the process of using charset" according to the above tag.
The second sentence(use that) can better express "the choice of charset" needs to be based on the above tag.
Is this correct?
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 spec for an argument should be a noun. You can add attributes to describe it in more detail, which can be an adjective, or even a clause. This is what's shown in the 2nd line (I cannot call it a sentence because it's just a noun with an attributive clause). On the other hand, the 1st is a full sentence and it's not what we need here.
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 spec for an argument should be a noun. You can add attributes to describe it in more detail, which can be an adjective, or even a clause. This is what's shown in the 2nd line (I cannot call it a sentence because it's just a noun with an attributive clause). On the other hand, the 1st is a full sentence and it's not what we need here.
Thanks so much for your detailed explanation.
I get it now.
Two comments:
|
Got it.
For the second, I will take care of that. |
…cation and improve an expression according to the specification
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 to me. Thanks!
@jquanC This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 257 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@XueleiFan) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Cheers and appreciation! And I have learned more from your guidance. |
@jquanC Please type |
/integrate |
Thanks for your reminder! |
/sponsor |
Going to push as commit 3e12241.
Your commit was automatically rebased without conflicts. |
Thanks for your valuable advice. I will continue to improve.
Best wishes!
…------------------ 原始邮件 ------------------
发件人: "openjdk/jdk" ***@***.***>;
发送时间: 2022年7月22日(星期五) 中午1:25
***@***.***>;
***@***.******@***.***>;
主题: Re: [openjdk/jdk] 8290775: Some doc errors in DerOutputStream.java (PR #9585)
On the second point, I have some doubts. 1) Here don't need to add @.*** charset" because it's clear to everyone? @.*** enc" does not seem to be used in the method. Shouldn't it be deleted?
Sorry for the confusing.
I think it is fine to update the "param enc" to "param charset", but it may be not necessary to update the parameter description. With "parameter description", I refer to this part, "the name of the encoder that should be used corresponding to the above tag".
The parameter description may be still confusing to someone, as the 'the name of the encoder' is not well-defined here. Maybe, it could be simplified as "the charset that ..."
Here is the proposed update:
* @param enc the name of the encoder that should be used corresponding
to the above tag.
@param charset the specified character set encodes a string into a
sequence of bytes using
I may use an update like :
* @param enc the name of the encoder that should be used corresponding
to the above tag.
@param charset the charset that is should used corresponding to the
above tag.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
There are some doc errors in sun.security.util.DerOutputStream, like the followings,
The parameter is charset, but not enc.
The parameter is buf, but not i.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9585/head:pull/9585
$ git checkout pull/9585
Update a local copy of the PR:
$ git checkout pull/9585
$ git pull https://git.openjdk.org/jdk pull/9585/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9585
View PR using the GUI difftool:
$ git pr show -t 9585
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9585.diff