chore: AbstractDependencyMojo PMD-Rule: EmptyControlStatement#2368
Closed
Pankraz76 wants to merge 1 commit intoapache:masterfrom
Closed
chore: AbstractDependencyMojo PMD-Rule: EmptyControlStatement#2368Pankraz76 wants to merge 1 commit intoapache:masterfrom
AbstractDependencyMojo PMD-Rule: EmptyControlStatement#2368Pankraz76 wants to merge 1 commit intoapache:masterfrom
Conversation
Pankraz76
commented
May 21, 2025
| DigestInputStream dis = new DigestInputStream(is, digester); | ||
|
|
||
| for (byte[] buffer = new byte[1024 * 4]; dis.read(buffer) >= 0; ) { | ||
| // just read it |
Contributor
Author
There was a problem hiding this comment.
IDE: 'just' might sound dismissive or oversimplify what readers consider a complex task
Pankraz76
commented
May 21, 2025
| getLog().info("[MAVEN-CORE-IT-LOG] Thread " + this + " uses " + tccl); | ||
| Thread.currentThread().setContextClassLoader(tccl); | ||
| while (go.isEmpty()) { | ||
| // wait for start |
Contributor
Author
There was a problem hiding this comment.
seems to miss debounce. These type of loop seems inperformant
6e51ce3 to
d89bd21
Compare
Pankraz76
commented
May 21, 2025
...pendency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java
Outdated
Show resolved
Hide resolved
1296c7b to
964ebec
Compare
Pankraz76
commented
May 21, 2025
| while (go.isEmpty()) { | ||
| // wait for start | ||
| try { | ||
| Thread.sleep(100); // wait for the start |
Contributor
Author
There was a problem hiding this comment.
Suggested change
| Thread.sleep(100); // wait for the start | |
| Thread.sleep(1_000); // wait for the start |
is this any good? whats the right period here?
AbstractDependencyMojo
964ebec to
f9b0463
Compare
AbstractDependencyMojoAbstractDependencyMojo PMD-Rule: EmptyControlStatement
elharo
requested changes
May 22, 2025
| for (byte[] buffer = new byte[1024 * 4]; dis.read(buffer) >= 0; ) { | ||
| // just read it | ||
| } | ||
| new DigestInputStream(is, digester).read(new byte[1024 * 4]); // only read required. |
Contributor
There was a problem hiding this comment.
No, this is incorrect. There's no guarantee this read will read as much as is needed
elharo
requested changes
May 22, 2025
Contributor
elharo
left a comment
There was a problem hiding this comment.
Looks like another case where PMD is simply wrong. Please consider this possibility before sending a pR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@SuppressWarnings("checkstyle:UnusedLocalVariable")#2365@SuppressWarnings("checkstyle:UnusedLocalVariable")#2366