@Override
    public void visitNewExpression(@NotNull GrNewExpression newExpression) {
      super.visitNewExpression(newExpression);
      final GrCodeReferenceElement refElement = newExpression.getReferenceElement();
      if (refElement == null) return;      //new expression is not correct so we shouldn't check it
      
      final PsiElement parent = newExpression.getParent();

      if (parent instanceof GrCodeBlock || parent instanceof GroovyFile) {
        if (parent instanceof GrOpenBlock || parent instanceof GrClosableBlock) {
          if (ControlFlowUtils.openBlockCompletesWithStatement(((GrCodeBlock)parent), newExpression)) {
            return;
          }
        }
        registerError(refElement, newExpression.getArrayCount());
      }
    }
@Override
    public void visitNewExpression(@NotNull GrNewExpression newExpression)