diff --git a/bubble-server/src/main/java/bubble/ApiConstants.java b/bubble-server/src/main/java/bubble/ApiConstants.java index f8184dbb..d5d04fbf 100644 --- a/bubble-server/src/main/java/bubble/ApiConstants.java +++ b/bubble-server/src/main/java/bubble/ApiConstants.java @@ -56,14 +56,23 @@ public class ApiConstants { public static final ObjectMapper DB_JSON_MAPPER = COMPACT_MAPPER; - @Getter(lazy=true) private static final String debugFqdn = initDebugFqdn(); - private static String initDebugFqdn() { - try { - return FileUtil.toString(HOME_DIR+"/debug_fqdn").trim(); - } catch (Exception e) { - log.debug("initDebugFqdn: "+shortError(e)); - return "~debug_fqdn_disabled~"; // will never match any fqdn + // for some reason @Getter(lazy=true) causes compilation problems when other classes try to call getter + // so we implement lombok lazy-getter logic manuall here + private static final AtomicReference debugFqdn = new AtomicReference<>(); + public static String getDebugFqdn () { + if (debugFqdn.get() == null) { + synchronized (debugFqdn) { + if (debugFqdn.get() == null) { + try { + debugFqdn.set(FileUtil.toString(HOME_DIR + "/debug_fqdn").trim()); + } catch (Exception e) { + log.debug("initDebugFqdn: " + shortError(e)); + debugFqdn.set("~debug_fqdn_disabled~"); // will never match any fqdn + } + } + } } + return debugFqdn.get(); } private static String initDefaultDomain() {