From d7e97c0ae1a7a7791d84381745ade73e3de0dfbb Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Wed, 22 Sep 2021 22:39:58 -0700 Subject: [PATCH] Synchronize access to AccessTransformSet$Class#getOrCreateClass --- paperweight-lib/src/main/kotlin/tasks/ApplyAccessTransform.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paperweight-lib/src/main/kotlin/tasks/ApplyAccessTransform.kt b/paperweight-lib/src/main/kotlin/tasks/ApplyAccessTransform.kt index 1d2715b..ad1ec75 100644 --- a/paperweight-lib/src/main/kotlin/tasks/ApplyAccessTransform.kt +++ b/paperweight-lib/src/main/kotlin/tasks/ApplyAccessTransform.kt @@ -170,8 +170,9 @@ class AccessTransformerVisitor( super.visitInnerClass(name, outerName, innerName, completedClassAt(name).get().apply(access)) } - private fun completedClassAt(className: String): AccessTransformSet.Class = + private fun completedClassAt(className: String): AccessTransformSet.Class = synchronized(at) { at.getOrCreateClass(className).apply { complete(inheritanceProvider) } + } } private const val RESET_ACCESS: Int = (Opcodes.ACC_PUBLIC or Opcodes.ACC_PRIVATE or Opcodes.ACC_PROTECTED).inv()