From c0cdf855f33ad27f9ea6741781a52ab37afce6be Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Fri, 22 May 2020 11:42:39 +0200 Subject: Fix thread-unsafe extension point registering --- src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/kotlin/com/replaymod') diff --git a/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt b/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt index 8df1f68..3849483 100644 --- a/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt +++ b/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt @@ -64,8 +64,10 @@ class Transformer(private val map: MappingSet) { EnvironmentConfigFiles.JVM_CONFIG_FILES ) val rootArea = Extensions.getRootArea() - if (!rootArea.hasExtensionPoint(CustomExceptionHandler.KEY)) { - rootArea.registerExtensionPoint(CustomExceptionHandler.KEY.name, CustomExceptionHandler::class.java.name, ExtensionPoint.Kind.INTERFACE) + synchronized(rootArea) { + if (!rootArea.hasExtensionPoint(CustomExceptionHandler.KEY)) { + rootArea.registerExtensionPoint(CustomExceptionHandler.KEY.name, CustomExceptionHandler::class.java.name, ExtensionPoint.Kind.INTERFACE) + } } val project = environment.project as MockProject -- cgit