Skip to content
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

A little more code cleanup #716

Merged
merged 1 commit into from
Apr 22, 2022
Merged

Conversation

sleberknight
Copy link
Member

  • Remove unnecessary semicolon in KillTimeoutAction enum
  • Convert a 'var' (which was hiding the wrapper type Integer) to int
    (IntelliJ found that, not me...)
  • Replace inefficient conversion of OutputStream to a String in
    JSchSlf4jLoggerTest. Instead of getting the byte array and then
    calling String's constructor, there is a toString(Charset) method
    that was added to OutputStream in JDK 10 to directly convert to
    a String from the stream. This avoids the overhead of doing an
    OutputStream#toByteArray, which performs an array copy operation.

* Remove unnecessary semicolon in KillTimeoutAction enum
* Convert a 'var' (which was hiding the wrapper type Integer) to int
  (IntelliJ found that, not me...)
* Replace inefficient conversion of OutputStream to a String in
  JSchSlf4jLoggerTest. Instead of getting the byte array and then
  calling String's constructor, there is a toString(Charset) method
  that was added to OutputStream in JDK 10 to directly convert to
  a String from the stream. This avoids the overhead of doing an
  OutputStream#toByteArray, which performs an array copy operation.
@sleberknight sleberknight added the code cleanup Fix issues reported by Sonar or any other code analysis tools label Apr 22, 2022
@sleberknight sleberknight added this to the 2.0.0 milestone Apr 22, 2022
@sleberknight sleberknight self-assigned this Apr 22, 2022
@sonarcloud
Copy link

sonarcloud bot commented Apr 22, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@sleberknight sleberknight merged commit 902935e into master Apr 22, 2022
@sleberknight sleberknight deleted the misc-code-cleanup-2022-04-21 branch April 22, 2022 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Fix issues reported by Sonar or any other code analysis tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant