Skip to content

Conversation

@devCod3r
Copy link
Contributor

@devCod3r devCod3r commented Apr 8, 2023

Fixes #3019

Motivation

Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms.
Above issue is the reason why this change is introduced.
Issue #3019

Modifications

Passed Constants.DEFAULT_CHARSET as the parameter to getBytes() method in line 115,116,167,168,178,179 of TCPClientHandler.java class.

Documentation

  • Does this pull request introduce a new feature?
  • Ans: no
  • If a feature is not applicable for documentation, explain why?
  • Ans: Passed a parameter to the existing method in TCPClientHandler.java class.

@xwm1992 xwm1992 changed the title #3019 Issue: Used an alternative API and specified a Charset name or Charset object explicitly. [ISSUE #3019] Found reliance on default encoding: String.getBytes() [TCPClientHandler] Apr 10, 2023
@codecov
Copy link

codecov bot commented Apr 10, 2023

Codecov Report

Merging #3665 (c14ddac) into master (7f00524) will not change coverage.
The diff coverage is 0.00%.

❗ Current head c14ddac differs from pull request most recent head 8e03be3. Consider uploading reports for the commit 8e03be3 to get more accurate results

@@            Coverage Diff            @@
##             master    #3665   +/-   ##
=========================================
  Coverage     13.76%   13.76%           
  Complexity     1291     1291           
=========================================
  Files           571      571           
  Lines         29239    29239           
  Branches       2885     2885           
=========================================
  Hits           4024     4024           
  Misses        24841    24841           
  Partials        374      374           
Impacted Files Coverage Δ
...ntmesh/runtime/admin/handler/TCPClientHandler.java 4.25% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@xwm1992 xwm1992 merged commit d8e7df3 into apache:master Apr 10, 2023
xuhongjia pushed a commit to Deckers-Ohana/eventmesh that referenced this pull request Mar 13, 2025
[ISSUE apache#3019] Found reliance on default encoding: String.getBytes() [TCPClientHandler]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Found reliance on default encoding: String.getBytes() [TCPClientHandler]

3 participants