Skip to content

Conversation

DigestInputStream dis = new DigestInputStream(is, digester);

for (byte[] buffer = new byte[1024 * 4]; dis.read(buffer) >= 0; ) {
// just read it
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@Pankraz76 Pankraz76 changed the title Empty control statement error prone pmd EmptyControlStatement May 21, 2025
@Pankraz76 Pankraz76 force-pushed the EmptyControlStatement-error-prone-pmd branch from 6e51ce3 to d89bd21 Compare May 21, 2025 12:38
@Pankraz76 Pankraz76 force-pushed the EmptyControlStatement-error-prone-pmd branch from 1296c7b to 964ebec Compare May 21, 2025 12:39
while (go.isEmpty()) {
// wait for start
try {
Thread.sleep(100); // wait for the start
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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?

@Pankraz76 Pankraz76 marked this pull request as ready for review May 21, 2025 12:41
@Pankraz76 Pankraz76 changed the title EmptyControlStatement EmptyControlStatement: AbstractDependencyMojo May 21, 2025
@Pankraz76 Pankraz76 force-pushed the EmptyControlStatement-error-prone-pmd branch from 964ebec to f9b0463 Compare May 21, 2025 19:25
@Pankraz76 Pankraz76 changed the title EmptyControlStatement: AbstractDependencyMojo chore: AbstractDependencyMojo PMD-Rule: EmptyControlStatement 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.
Copy link
Contributor

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

Copy link
Contributor

@elharo elharo left a 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

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