Skip to content

Linting round3#380

Merged
gregschohn merged 2 commits intoopensearch-project:mainfrom
gregschohn:Linting_Round3
Nov 5, 2023
Merged

Linting round3#380
gregschohn merged 2 commits intoopensearch-project:mainfrom
gregschohn:Linting_Round3

Conversation

@gregschohn
Copy link
Copy Markdown
Collaborator

Description

More improvements to fix issues caught in running a lint checker.

Testing

./gradlew allTests

Check List

  • New functionality includes testing
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…eptions are handled (see SonarQube rule: S2142).

Signed-off-by: Greg Schohn <greg.schohn@gmail.com>
Signed-off-by: Greg Schohn <greg.schohn@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 2, 2023

Codecov Report

Merging #380 (f740cbf) into main (50e3d76) will decrease coverage by 0.33%.
The diff coverage is 46.72%.

@@             Coverage Diff              @@
##               main     #380      +/-   ##
============================================
- Coverage     64.23%   63.91%   -0.33%     
+ Complexity      726      721       -5     
============================================
  Files            82       82              
  Lines          3277     3289      +12     
  Branches        306      306              
============================================
- Hits           2105     2102       -3     
- Misses          983      997      +14     
- Partials        189      190       +1     
Flag Coverage Δ
unittests 63.91% <46.72%> (-0.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...replay/datahandlers/TransformedPacketReceiver.java 71.42% <ø> (ø)
...dlers/http/HttpJsonMessageWithFaultingPayload.java 100.00% <ø> (ø)
.../datahandlers/http/NettyJsonContentCompressor.java 87.50% <100.00%> (ø)
...y/datahandlers/http/NettyJsonToByteBufHandler.java 95.55% <100.00%> (ø)
...datahandlers/http/RequestPipelineOrchestrator.java 96.49% <100.00%> (ø)
...rch/migrations/replay/HttpMessageAndTimestamp.java 84.61% <0.00%> (+7.87%) ⬆️
.../replay/datahandlers/PayloadAccessFaultingMap.java 56.25% <0.00%> (-1.82%) ⬇️
...http/ListKeyAdaptingCaseInsensitiveHeadersMap.java 94.11% <66.66%> (-5.89%) ⬇️
...tyDecodedHttpRequestPreliminaryConvertHandler.java 95.83% <83.33%> (-0.17%) ⬇️
...tahandlers/http/NettyJsonBodySerializeHandler.java 76.19% <0.00%> (-1.09%) ⬇️
... and 9 more

@gregschohn gregschohn marked this pull request as ready for review November 2, 2023 13:15
new FileOutputStream(params.outputFilename, true);
var bufferedOutputStream = new BufferedOutputStream(outputStream);
var blockingTrafficStream = TrafficCaptureSourceFactory.createTrafficCaptureSource(params,
Duration.ofSeconds(params.lookaheadTimeSeconds));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add another line here or something to distinguish that the try parenthesis has now ended

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You & I think alike ;).
I got fed up with too many resources and not knowing where the distinction was & did that in the last delinting PR.

try {
pullCaptureFromSourceToAccumulator(trafficChunkStream, trafficToHttpTransactionAccumulator);
} catch (InterruptedException ex) {
throw ex;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add a Thread.currentThread().interrupt(); here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The general rule is if you're suppressing that this was an interruption, you should reset the interrupt state. Since we're propagating (so that we don't obscure it), the final catch-receiver can handle re-interrupting.

@gregschohn gregschohn merged commit f740cbf into opensearch-project:main Nov 5, 2023
@gregschohn gregschohn deleted the Linting_Round3 branch November 6, 2023 12:59
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.

2 participants