mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
IDEA-231900 Better support for parameters
GitOrigin-RevId: ccc2e361e5542748b09842480393d77e7cb0893e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
320de07c32
commit
1ed6f1dfd0
@@ -135,10 +135,10 @@ public class JavaI18nUtil extends I18nUtil {
|
||||
PsiParameter parameter = method.getParameterList().getParameter(idx.getAsInt());
|
||||
if (parameter != null) {
|
||||
PsiType parameterType = parameter.getType();
|
||||
PsiType receiverType = callExpression.getReceiverType();
|
||||
if (receiverType instanceof PsiClassType) {
|
||||
PsiClassType.ClassResolveResult result = ((PsiClassType)receiverType).resolveGenerics();
|
||||
parameterType = result.getSubstitutor().substitute(parameterType);
|
||||
PsiElement psi = callExpression.getSourcePsi();
|
||||
if (psi instanceof PsiMethodCallExpression) {
|
||||
PsiSubstitutor substitutor = ((PsiMethodCallExpression)psi).getMethodExpression().advancedResolve(false).getSubstitutor();
|
||||
parameterType = substitutor.substitute(parameterType);
|
||||
}
|
||||
if (AnnotationUtil.findTypeAnnotationInHierarchy(parameterType, Collections.singleton(annFqn)) != null) {
|
||||
return true;
|
||||
|
||||
@@ -30,4 +30,13 @@ class NlsTypeUse {
|
||||
map.put("foo", <warning descr="Hardcoded string literal: \"bar\"">"bar"</warning>);
|
||||
cons.accept(<warning descr="Hardcoded string literal: \"foo\"">"foo"</warning>, "bar");
|
||||
}
|
||||
|
||||
void typeArgsCustomType(NlsValueMap<String> map, NlsValueMap2<String, String> map2) {
|
||||
map.put("foo", <warning descr="Hardcoded string literal: \"bar\"">"bar"</warning>);
|
||||
map2.put("foo", <warning descr="Hardcoded string literal: \"bar\"">"bar"</warning>);
|
||||
}
|
||||
|
||||
interface NlsValueMap<K> extends Map<K, @Nls String> {}
|
||||
|
||||
interface NlsValueMap2<K, V> extends Map<K, @Nls V> {}
|
||||
}
|
||||
Reference in New Issue
Block a user