@Override public void visitNewExpression(@NotNull PsiNewExpression expression) {
    startElement(expression);

    PsiType type = expression.getType();
    if (type instanceof PsiArrayType) {
      PsiArrayInitializerExpression arrayInitializer = expression.getArrayInitializer();
      if (arrayInitializer != null) {
        initializeArray(arrayInitializer, expression);
        return;
      }
      final PsiExpression[] dimensions = expression.getArrayDimensions();
      int dims = dimensions.length;
      if (dims > 0) {
        for (final PsiExpression dimension : dimensions) {
          dimension.accept(this);
          generateBoxingUnboxingInstructionFor(dimension, PsiTypes.intType());
        }
        DfaControlTransferValue transfer = createTransfer("java.lang.NegativeArraySizeException");
        for (int i = dims - 1; i >= 0; i--) {
          addInstruction(new EnsureInstruction(new NegativeArraySizeProblem(dimensions[i]),
                                               RelationType.GE, DfTypes.intValue(0), transfer, true));
          if (i != 0) {
            addInstruction(new PopInstruction());
          }
        }
      }
      else {
        pushUnknown();
      }
      DfType arrayValue = TypeConstraints.exact(type).asDfType().meet(DfTypes.LOCAL_OBJECT);
      addInstruction(new WrapDerivedVariableInstruction(arrayValue, SpecialField.ARRAY_LENGTH, new JavaExpressionAnchor(expression)));

      initializeSmallArray((PsiArrayType)type, dimensions);
    }
    else {
      PsiExpression qualifier = expression.getQualifier();
      if (qualifier != null) {
        qualifier.accept(this);
      } else {
        DfaValue qualifierValue = myFactory.getUnknown();
        PsiClass aClass = PsiUtil.resolveClassInClassTypeOnly(type);
        if (aClass != null && !aClass.hasModifierProperty(PsiModifier.STATIC)) {
          PsiClass outerClass = aClass.getContainingClass();
          if (outerClass != null && InheritanceUtil.hasEnclosingInstanceInScope(outerClass, expression, true, false)) {
            qualifierValue = ThisDescriptor.createThisValue(myFactory, outerClass);
          }
        }
        addInstruction(new JvmPushInstruction(qualifierValue, null));
      }

      PsiMember constructorOrClass = pushConstructorArguments(expression);
      PsiMethod constructor = ObjectUtils.tryCast(constructorOrClass, PsiMethod.class);
      PsiAnonymousClass anonymousClass = expression.getAnonymousClass();
      if (anonymousClass != null) {
        handleClosure(anonymousClass);
      }

      addConditionalErrorThrow();
      DfaValue precalculatedNewValue = getPrecalculatedNewValue(expression);
      List<? extends MethodContract> contracts = constructor == null ? Collections.emptyList() :
                                                 JavaMethodContractUtil.getMethodCallContracts(constructor, null);
      contracts = DfaUtil.addRangeContracts(constructor, contracts);
      addInstruction(new MethodCallInstruction(expression, precalculatedNewValue, contracts));
      processFailResult(constructor, contracts, expression);

      addMethodThrows(constructorOrClass);
    }

    finishElement(expression);
  }
@Override public void visitNewExpression(@NotNull PsiNewExpression expression)