From 77192020afb651756c6b35f287a29a07c07bacf9 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Wed, 2 Dec 2020 06:42:06 +0200 Subject: Make checkAtmosphereSupport() non-static (#12131) (#12159) Fixes: https://github.com/vaadin/multiplatform-runtime/issues/77 Authored-by: Tatu Lund --- server/src/main/java/com/vaadin/server/VaadinService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'server/src') diff --git a/server/src/main/java/com/vaadin/server/VaadinService.java b/server/src/main/java/com/vaadin/server/VaadinService.java index 4f01820868..31ddf7b8ba 100644 --- a/server/src/main/java/com/vaadin/server/VaadinService.java +++ b/server/src/main/java/com/vaadin/server/VaadinService.java @@ -145,7 +145,7 @@ public abstract class VaadinService implements Serializable { private Iterable dependencyFilters; private ConnectorIdGenerator connectorIdGenerator; - private boolean atmosphereAvailable = checkAtmosphereSupport(); + private Boolean atmosphereAvailable = null; /** * Keeps track of whether a warning about missing push support has already @@ -1853,7 +1853,7 @@ public abstract class VaadinService implements Serializable { * is not available. */ public boolean ensurePushAvailable() { - if (atmosphereAvailable) { + if (isAtmosphereAvailable()) { return true; } else { if (!pushWarningEmitted) { @@ -1865,7 +1865,7 @@ public abstract class VaadinService implements Serializable { } } - private static boolean checkAtmosphereSupport() { + private boolean checkAtmosphereSupport() { String rawVersion = AtmospherePushConnection.getAtmosphereVersion(); if (rawVersion == null) { return false; @@ -1888,6 +1888,9 @@ public abstract class VaadinService implements Serializable { * @return true if Atmosphere is available, false otherwise */ protected boolean isAtmosphereAvailable() { + if (atmosphereAvailable == null) { + atmosphereAvailable = checkAtmosphereSupport(); + } return atmosphereAvailable; } -- cgit v1.2.3