Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public void run() {
assertEquals(Boolean.TRUE, get(key));
} catch (Throwable t) {
error.compareAndSet(null, t);
t.printStackTrace();
}
}
}
Expand All @@ -91,6 +90,9 @@ public void run() {
for (Thread thread : threads) {
thread.join();
}
assertNull(error.get(), String.valueOf(error.get()));
Throwable t = error.get();
if (t != null) {
throw new AssertionError(t);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public void run() {
assertEquals(Boolean.TRUE, get(key));
} catch (Throwable t) {
error.compareAndSet(null, t);
t.printStackTrace();
}
}
}
Expand All @@ -127,6 +126,9 @@ public void run() {
for (Thread thread : threads) {
thread.join();
}
assertNull(error.get(), String.valueOf(error.get()));
Throwable t = error.get();
if (t != null) {
throw new AssertionError(t);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,10 @@ protected static class Results {

volatile String errorPath;

private int exceptionCount;

private int cycleCount;

public Results(CollectResult result, RepositorySystemSession session) {
this.result = result;

Expand All @@ -569,7 +573,8 @@ public synchronized String getErrorPath() {
}

public synchronized void addException(Dependency dependency, Exception e, List<DependencyNode> nodes) {
if (maxExceptions < 0 || result.getExceptions().size() < maxExceptions) {
if (maxExceptions < 0 || exceptionCount < maxExceptions) {
exceptionCount++;
result.addException(e);
if (errorPath == null) {
StringBuilder buffer = new StringBuilder(256);
Expand All @@ -592,7 +597,8 @@ public synchronized void addException(Dependency dependency, Exception e, List<D
}

public synchronized void addCycle(List<DependencyNode> nodes, int cycleEntry, Dependency dependency) {
if (maxCycles < 0 || result.getCycles().size() < maxCycles) {
if (maxCycles < 0 || cycleCount < maxCycles) {
cycleCount++;
result.addCycle(new DefaultDependencyCycle(nodes, cycleEntry, dependency));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -737,7 +738,7 @@ public LocalArtifactResult find(RepositorySystemSession session, LocalArtifactRe
try {
result.setFile(TestFileUtils.createTempFile(""));
} catch (IOException e) {
e.printStackTrace();
throw new UncheckedIOException(e);
}
return result;
}
Expand All @@ -749,7 +750,7 @@ public LocalMetadataResult find(RepositorySystemSession session, LocalMetadataRe
try {
result.setFile(TestFileUtils.createTempFile(""));
} catch (IOException e) {
e.printStackTrace();
throw new UncheckedIOException(e);
}
return result;
}
Expand Down Expand Up @@ -802,7 +803,7 @@ public LocalArtifactResult find(RepositorySystemSession session, LocalArtifactRe
try {
result.setFile(TestFileUtils.createTempFile(""));
} catch (IOException e) {
e.printStackTrace();
throw new UncheckedIOException(e);
}
return result;
}
Expand Down Expand Up @@ -871,7 +872,7 @@ public LocalArtifactResult find(RepositorySystemSession session, LocalArtifactRe
try {
result.setFile(TestFileUtils.createTempFile(""));
} catch (IOException e) {
e.printStackTrace();
throw new UncheckedIOException(e);
}
return result;
}
Expand Down Expand Up @@ -972,7 +973,7 @@ public LocalArtifactResult find(RepositorySystemSession session, LocalArtifactRe
try {
result.setFile(TestFileUtils.createTempFile(""));
} catch (IOException e) {
e.printStackTrace();
throw new UncheckedIOException(e);
}
return result;
}
Expand All @@ -984,7 +985,7 @@ public LocalMetadataResult find(RepositorySystemSession session, LocalMetadataRe
try {
result.setFile(TestFileUtils.createTempFile(""));
} catch (IOException e) {
e.printStackTrace();
throw new UncheckedIOException(e);
}
return result;
}
Expand Down
Loading