private Map<String, Theme> _getThemes(long companyId) { Map<String, Theme> themes = _themesPool.get(companyId); if (themes != null) { return themes; } themes = new ConcurrentHashMap<String, Theme>(); for (Map.Entry<String, Theme> entry : _themes.entrySet()) { String themeId = entry.getKey(); Theme theme = entry.getValue(); if (theme.isCompanyAvailable(companyId)) { themes.put(themeId, theme); } } _themesPool.put(companyId, themes); return themes; }
private Map<String, Theme> _getThemes(long companyId) { Map<String, Theme> themes = _themesPool.get(companyId); if (themes == null) { themes = new ConcurrentHashMap<String, Theme>(); Iterator<Map.Entry<String, Theme>> itr = _themes.entrySet().iterator(); while (itr.hasNext()) { Map.Entry<String, Theme> entry = itr.next(); String themeId = entry.getKey(); Theme theme = entry.getValue(); if (theme.isCompanyAvailable(companyId)) { themes.put(themeId, theme); } } _themesPool.put(companyId, themes); } return themes; }