You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "mrkartik00 (via GitHub)" <gi...@apache.org> on 2024/08/03 13:30:41 UTC
[PR] [#4209] refactor(DER): use StandardCharsets.UTF_8 instead of hardcoded "UTF-8" [gravitino]
mrkartik00 opened a new pull request, #4344:
URL: https://github.com/apache/gravitino/pull/4344
[#4209] refactor(DER): replace hardcoded string with StandardCharsets.UTF_8
Replaced hardcoded "UTF-8" with StandardCharsets.UTF_8 in DER.getAsString() method. This change improves code readability and aligns with modern Java practices for character encoding. No functional changes; only improved encoding method usage.
### What changes were proposed in this pull request?
This pull request refactors the DER class to use StandardCharsets.UTF_8 instead of the hardcoded "UTF-8" string. The change specifically updates the DER.getAsString() method to improve code readability and align with modern Java practices for character encoding.
### Why are the changes needed?
Readability: Using StandardCharsets.UTF_8 instead of a hardcoded string makes the code more readable and less prone to errors. It clearly indicates that UTF-8 encoding is used.
Consistency: Adhering to modern Java practices by using StandardCharsets ensures that the codebase is consistent with current standards and improves maintainability.
Fix: #4209
### Does this PR introduce _any_ user-facing change?
No, this pull request does not introduce any user-facing changes. The modifications are internal refactorings that do not alter any functionality or API behavior.
### How was this patch tested?
Run Existing Unit Tests:
Executed all existing unit tests to confirm that the refactoring did not affect functionality. All tests passed successfully.
Manual Verification:
Checked that components using the DER class continue to work correctly.
Ensured that DER.getAsString() properly converts byte buffers to strings.
Code Review:
Reviewed the changes to verify correct usage of StandardCharsets.UTF_8 and ensure no unintended side effects.
No additional tests were needed as the changes were only refactoring and did not introduce new features or fix bugs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4209] refactor(DER): use StandardCharsets.UTF_8 instead of hardcoded "UTF-8" [gravitino]
Posted by "mrkartik00 (via GitHub)" <gi...@apache.org>.
mrkartik00 commented on PR #4344:
URL: https://github.com/apache/gravitino/pull/4344#issuecomment-2271510881
@FANNG1 Done the changes in HTTPClient.java you can check
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4209] refactor(DER): use StandardCharsets.UTF_8 instead of hardcoded "UTF-8" [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao closed pull request #4344: [#4209] refactor(DER): use StandardCharsets.UTF_8 instead of hardcoded "UTF-8"
URL: https://github.com/apache/gravitino/pull/4344
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4209] refactor(DER): use StandardCharsets.UTF_8 instead of hardcoded "UTF-8" [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #4344:
URL: https://github.com/apache/gravitino/pull/4344#issuecomment-5408357880
Thank you for your contribution! Since this PR has been inactive for a long time, we're closing it to keep the PR queue manageable. If you'd like to continue working on this, please feel free to reopen it (or open a new PR) — we'd welcome it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4209] refactor(DER): use StandardCharsets.UTF_8 instead of hardcoded "UTF-8" [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on PR #4344:
URL: https://github.com/apache/gravitino/pull/4344#issuecomment-2268001839
Hi, @mrkartik00 , thanks for your PR, some other codes are using `UTF-8` directly like `HTTPClient.java` etcs, could you fix them all?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4209] refactor(DER): use StandardCharsets.UTF_8 instead of hardcoded "UTF-8" [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on PR #4344:
URL: https://github.com/apache/gravitino/pull/4344#issuecomment-2272453643
could you fix it in one PR? "UTF-8" exists in `.//integration-test/src/test/java/org/apache/gravitino/integration/test/store/relational/service/FilesetMetaServiceIT.java` and `.//integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/AbstractIT.java` too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org