diff --git a/java/openapi/src/com/intellij/patterns/PsiMethodPattern.java b/java/openapi/src/com/intellij/patterns/PsiMethodPattern.java index 741c4a321c47..ac3ecf5d4209 100644 --- a/java/openapi/src/com/intellij/patterns/PsiMethodPattern.java +++ b/java/openapi/src/com/intellij/patterns/PsiMethodPattern.java @@ -18,12 +18,10 @@ package com.intellij.patterns; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Ref; -import com.intellij.psi.PsiClass; -import com.intellij.psi.PsiMethod; -import com.intellij.psi.PsiParameter; -import com.intellij.psi.PsiParameterList; +import com.intellij.psi.*; import com.intellij.psi.search.searches.SuperMethodsSearch; import com.intellij.psi.util.MethodSignatureBackedByPsiMethod; +import com.intellij.psi.util.TypeConversionUtil; import com.intellij.util.ProcessingContext; import com.intellij.util.Processor; import org.jetbrains.annotations.NonNls; @@ -67,13 +65,28 @@ public class PsiMethodPattern extends PsiMemberPattern 0) { final PsiParameter[] psiParameters = parameterList.getParameters(); for (int i = 0; i < dotsIndex; i++) { - if (!Comparing.equal("?", types[i]) && !types[i].equals(psiParameters[i].getType().getCanonicalText())) { + if (!Comparing.equal("?", types[i]) && !typeEquivalent(psiParameters[i].getType(), types[i])) { return false; } } } return true; } + + private boolean typeEquivalent(PsiType type, String expectedText) { + final PsiType erasure = TypeConversionUtil.erasure(type); + final String text; + if (erasure instanceof PsiEllipsisType && expectedText.endsWith("[]")) { + text = ((PsiEllipsisType)erasure).getComponentType().getCanonicalText() + "[]"; + } + else if (erasure instanceof PsiArrayType && expectedText.endsWith("...")) { + text = ((PsiArrayType)erasure).getComponentType().getCanonicalText() +"..."; + } + else { + text = erasure.getCanonicalText(); + } + return expectedText.equals(text); + } }); } diff --git a/plugins/IntelliLang/src/LanguageInjectionConfiguration.xml b/plugins/IntelliLang/src/LanguageInjectionConfiguration.xml index 2b18e260f1ec..40a0e9177876 100644 --- a/plugins/IntelliLang/src/LanguageInjectionConfiguration.xml +++ b/plugins/IntelliLang/src/LanguageInjectionConfiguration.xml @@ -111,6 +111,7 @@ + @@ -220,14 +221,40 @@ SimpleJdbcOperations (org.springframework.jdbc.core.simple) - ", "java.lang.Object...").definedInClass("org.springframework.jdbc.core.simple.SimpleJdbcOperations"))]]> + + + + + + + + + + + + + + + + - ", "java.lang.Object...").definedInClass("org.springframework.jdbc.core.simple.SimpleJdbcOperations"))]]> - ", "java.lang.Object...").definedInClass("org.springframework.jdbc.core.simple.SimpleJdbcOperations"))]]> + + + + + + + + + + + + + SqlCall.SqlCall (org.springframework.jdbc.object) @@ -239,6 +266,12 @@ + + SqlFunction.SqlFunction (org.springframework.jdbc.object) + + + + SqlOperation.newPreparedStatementCreator (org.springframework.jdbc.object)