PsiType (String typeText, PsiFile context) { Map<String, PsiType> map = context.getUserData(CACHED_TYPES); if (map == null) { map = new ConcurrentHashMap<>(); context.putUserData(CACHED_TYPES, map); } PsiType type = map.get(typeText); if (type == null || !type.isValid()) { type = JavaPsiFacade.getElementFactory(context.getProject()).createTypeFromText(typeText, context); map.put(typeText, type); } return type; }