From 1790c0ad4744d31ea3e30eb87822b4f506de449b Mon Sep 17 00:00:00 2001 From: OOP-778 <33358441+OOP-778@users.noreply.github.com> Date: Mon, 5 Sep 2022 23:39:52 +0300 Subject: [PATCH] Fix concurrent errors in URLClassLoaderAccess (#3403) --- .../common/plugin/classpath/URLClassLoaderAccess.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/common/plugin/classpath/URLClassLoaderAccess.java b/common/src/main/java/me/lucko/luckperms/common/plugin/classpath/URLClassLoaderAccess.java index 6cdc7a7d0..4e7f90af5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/plugin/classpath/URLClassLoaderAccess.java +++ b/common/src/main/java/me/lucko/luckperms/common/plugin/classpath/URLClassLoaderAccess.java @@ -167,8 +167,10 @@ public abstract class URLClassLoaderAccess { URLClassLoaderAccess.throwError(new NullPointerException("unopenedURLs or pathURLs")); } - this.unopenedURLs.add(url); - this.pathURLs.add(url); + synchronized (this.unopenedURLs) { + this.unopenedURLs.add(url); + this.pathURLs.add(url); + } } }