don't construct Map<X,null> type, it'll fail
authorpeter <peter.gromov@jetbrains.com>
Fri, 12 Mar 2010 19:57:46 +0000 (19:57 +0000)
committerpeter <peter.gromov@jetbrains.com>
Fri, 12 Mar 2010 19:58:02 +0000 (19:58 +0000)
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/params/GrParameterImpl.java

index 5b3e5fa90e5fcda3a38dfcc13b81396a0b1422d2..938626ec586a9780255db5c7696ea21948e55510 100644 (file)
@@ -200,7 +200,7 @@ public class GrParameterImpl extends GrVariableImpl implements GrParameter {
   private static PsiType getEntryForMap(PsiType map, PsiElementFactory factory, PsiElement context) {
     PsiType key = PsiUtil.substituteTypeParameter(map, CommonClassNames.JAVA_UTIL_MAP, 0, true);
     PsiType value = PsiUtil.substituteTypeParameter(map, CommonClassNames.JAVA_UTIL_MAP, 1, true);
-    if (key != null && value != null) {
+    if (key != null && key != PsiType.NULL && value != null && value != PsiType.NULL) {
       return factory.createTypeFromText("java.util.Map.Entry<" + key.getCanonicalText() + ", " + value.getCanonicalText() + ">", context);
     }
     return null;