Skip to content
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

Syncronize on unavailableRepositories before access the list #364

Merged
merged 1 commit into from
Oct 28, 2023
Merged
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 @@ -234,24 +234,28 @@ private void broadcastChangeEvent(URI location, int repositoryType, int kind, bo
* found, and <code>false</code> otherwise.
*/
private boolean checkNotFound(URI location) {
if (unavailableRepositories == null)
return false;
List<URI> badRepos = unavailableRepositories.get();
if (badRepos == null)
return false;
return badRepos.contains(location);
synchronized (repositoryLock) {
if (unavailableRepositories == null)
return false;
List<URI> badRepos = unavailableRepositories.get();
if (badRepos == null)
return false;
return badRepos.contains(location);
}
}

/**
* Clear the fact that we tried to load a repository at this location and did not find anything.
*/
private void clearNotFound(URI location) {
List<URI> badRepos;
if (unavailableRepositories != null) {
badRepos = unavailableRepositories.get();
if (badRepos != null) {
badRepos.remove(location);
return;
synchronized (repositoryLock) {
List<URI> badRepos;
if (unavailableRepositories != null) {
badRepos = unavailableRepositories.get();
if (badRepos != null) {
badRepos.remove(location);
return;
}
}
}
}
Expand Down
Loading