List<WSLDistribution> () { if (!isAvailable()) return List.of(); CachedDistributions cachedDistributions = myInstalledDistributions; if (cachedDistributions != null && cachedDistributions.isUpToDate()) { return cachedDistributions.myInstalledDistributions; } myInstalledDistributions = null; synchronized (LOCK) { cachedDistributions = myInstalledDistributions; if (cachedDistributions == null) { cachedDistributions = new CachedDistributions(loadInstalledDistributions()); myInstalledDistributions = cachedDistributions; myLastInstalledDistributions = cachedDistributions.myInstalledDistributions; } } return cachedDistributions.myInstalledDistributions; }