ClassMemberHolder (@NotNull Project project, @NotNull String source) { ConcurrentHashMap<String, ClassMemberHolder> map = project.getUserData(KEY); if (map == null) { map = new ConcurrentHashMap<>(); map = ((UserDataHolderEx)project).putUserDataIfAbsent(KEY, map); } ClassMemberHolder res = map.get(source); if (res == null) { res = new ClassMemberHolder(project, source); ClassMemberHolder oldValue = map.putIfAbsent(source, res); if (oldValue != null) { res = oldValue; } } assert source.equals(res.myClassSource) : "Store class sources in static constant, do not generate it in each call."; return res; }