TypeConstraint (@NotNull PsiElement context, @NotNull String signature) { int arrayDepth = 0; while (signature.length() > arrayDepth && signature.charAt(arrayDepth) == '[') { arrayDepth++; } TypeConstraint constraint = null; String nonArraySig = signature.substring(arrayDepth); if (nonArraySig.length() == 1) { if (arrayDepth > 0) { arrayDepth--; } PsiPrimitiveType primitiveType = PsiPrimitiveType.fromJvmTypeDescriptor(nonArraySig.charAt(0)); if (primitiveType != null) { constraint = TypeConstraints.exact(primitiveType.createArrayType()); } } else if (nonArraySig.startsWith("L")) { if (nonArraySig.endsWith(";")) { String jvmType = nonArraySig.substring(1, nonArraySig.length() - 1); constraint = myProvider.constraintFromJvmClassName(context, jvmType); } } if (constraint == null) return TypeConstraints.TOP; for (int i = 0; i < arrayDepth; i++) { constraint = constraint.arrayOf(); } return constraint; }