-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: AbstractDependencyMojo PMD-Rule: EmptyControlStatement
#2368
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
chore: AbstractDependencyMojo PMD-Rule: EmptyControlStatement
#2368
Conversation
| DigestInputStream dis = new DigestInputStream(is, digester); | ||
|
|
||
| for (byte[] buffer = new byte[1024 * 4]; dis.read(buffer) >= 0; ) { | ||
| // just read it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE: 'just' might sound dismissive or oversimplify what readers consider a complex task
| getLog().info("[MAVEN-CORE-IT-LOG] Thread " + this + " uses " + tccl); | ||
| Thread.currentThread().setContextClassLoader(tccl); | ||
| while (go.isEmpty()) { | ||
| // wait for start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to miss debounce. These type of loop seems inperformant
6e51ce3 to
d89bd21
Compare
...pendency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java
Outdated
Show resolved
Hide resolved
1296c7b to
964ebec
Compare
| while (go.isEmpty()) { | ||
| // wait for start | ||
| try { | ||
| Thread.sleep(100); // wait for the start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is incorrect. There's no guarantee this read will read as much as is needed
elharo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like another case where PMD is simply wrong. Please consider this possibility before sending a pR
@SuppressWarnings("checkstyle:UnusedLocalVariable")#2365@SuppressWarnings("checkstyle:UnusedLocalVariable")#2366