Skip to content

Commit

Permalink
Clearer reproducer
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Dec 1, 2023
1 parent d6fa103 commit 7dee8b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/model/PeepholePermalink.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected File getPermalinkFile(Job<?, ?> job) {
return b;
}

static @NonNull Map<String, Integer> cacheFor(@NonNull File buildDir) {
private static @NonNull Map<String, Integer> cacheFor(@NonNull File buildDir) {
synchronized (caches) {
Map<String, Integer> cache = caches.get(buildDir);
if (cache == null) {
Expand Down
19 changes: 17 additions & 2 deletions core/src/test/java/jenkins/model/PeepholePermalinkTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import static org.hamcrest.Matchers.is;

import hudson.model.PermalinkProjectAction;
import java.io.File;
import hudson.model.Run;
import org.junit.Test;

public final class PeepholePermalinkTest {
Expand All @@ -39,7 +39,22 @@ public void classLoadingDeadlock() throws Exception {
assertThat("successfully loaded LAST_STABLE_BUILD", PermalinkProjectAction.Permalink.LAST_STABLE_BUILD.getId(), is("lastStableBuild"));
});
t.start();
PeepholePermalink.cacheFor(new File("."));
new PeepholePermalink() {
@Override
public boolean apply(Run<?, ?> run) {
throw new UnsupportedOperationException();
}

@Override
public String getDisplayName() {
throw new UnsupportedOperationException();
}

@Override
public String getId() {
throw new UnsupportedOperationException();
}
};
t.join();
}

Expand Down

0 comments on commit 7dee8b2

Please sign in to comment.