SortedSet<Integer> (@NotNull final UExpression expression, @Nullable final String resourceBundleName) { final ULiteralExpression literalExpression; if (expression instanceof ULiteralExpression) { literalExpression = (ULiteralExpression)expression; } else if (expression instanceof UReferenceExpression) { final PsiElement resolved = ((UReferenceExpression)expression).resolve(); final PsiField field = resolved == null ? null : (PsiField)resolved; literalExpression = field != null && field.hasModifierProperty(PsiModifier.FINAL) && field.getInitializer() instanceof PsiLiteralExpression ? UastContextKt.toUElement(field.getInitializer(), ULiteralExpression.class) : null; } else { literalExpression = null; } final TreeSet<Integer> paramsCount = new TreeSet<>(); if (literalExpression == null) { return paramsCount; } for (PsiReference reference : UastLiteralUtils.getInjectedReferences(literalExpression)) { if (reference instanceof PsiPolyVariantReference) { for (ResolveResult result : ((PsiPolyVariantReference)reference).multiResolve(false)) { if (result.isValidResult() && result.getElement() instanceof IProperty) { try { final IProperty property = (IProperty)result.getElement(); if (resourceBundleName != null) { final PsiFile file = property.getPropertiesFile().getContainingFile(); if (!resourceBundleName.equals(BundleNameEvaluator.DEFAULT.evaluateBundleName(file))) { continue; } } final String propertyValue = property.getValue(); if (propertyValue == null) { continue; } paramsCount.add(getPropertyValuePlaceholdersCount(propertyValue)); } catch (IllegalArgumentException ignored) { } } } } } return paramsCount; }