Skip to content

Commit

Permalink
Fix concurrency issue when creating PomModel (#4609) (#4631)
Browse files Browse the repository at this point in the history
Co-authored-by: David Burström <davidburstrom@spotify.com>
  • Loading branch information
davidburstrom and davidburstromspotify committed Mar 18, 2022
1 parent 8bb4c85 commit 5325fd0
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -23,8 +23,15 @@ class DetektPomModel(project: Project) : UserDataHolderBase(), PomModel {
val extensionClass = TreeCopyHandler::class.java.name
@Suppress("DEPRECATION")
for (extensionArea in listOf(project.extensionArea, getRootArea())) {
if (!extensionArea.hasExtensionPoint(extension)) {
extensionArea.registerExtensionPoint(extension, extensionClass, ExtensionPoint.Kind.INTERFACE)
// Addresses https://github.com/detekt/detekt/issues/4609
synchronized(extensionArea) {
if (!extensionArea.hasExtensionPoint(extension)) {
extensionArea.registerExtensionPoint(
extension,
extensionClass,
ExtensionPoint.Kind.INTERFACE
)
}
}
}
}
Expand Down

0 comments on commit 5325fd0

Please sign in to comment.