From 472fd11d88284037267fbcf4ea467b952a36d5c0 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 19 Dec 2024 16:29:03 +0100 Subject: [PATCH] Fix singleton in PerconaConstraintsService --- .../liquibase/ext/percona/PerconaConstraintsService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/liquibase/ext/percona/PerconaConstraintsService.java b/src/main/java/liquibase/ext/percona/PerconaConstraintsService.java index 5783450b..072d71ec 100644 --- a/src/main/java/liquibase/ext/percona/PerconaConstraintsService.java +++ b/src/main/java/liquibase/ext/percona/PerconaConstraintsService.java @@ -31,12 +31,16 @@ import liquibase.structure.core.Table; public class PerconaConstraintsService { - private static PerconaConstraintsService instance = new PerconaConstraintsService(); + private static final PerconaConstraintsService INSTANCE = new PerconaConstraintsService(); private Logger log = Scope.getCurrentScope().getLog(PerconaConstraintsService.class); private boolean enabled = true; + private PerconaConstraintsService() { + // private constructor to prevent instantiation from somewhere else + } + public static PerconaConstraintsService getInstance() { - return instance; + return INSTANCE; } /**