예제 #1
0
  public static boolean hasClosureArguments(@Nullable GrCall call) {
    if (call == null) return false;

    for (PsiElement child = call.getFirstChild(); child != null; child = child.getNextSibling()) {
      if (child instanceof GrClosableBlock) return true;
    }
    return false;
  }
    private static boolean resolvesToDefaultConstructor(GrCall call) {
      PsiMethod method = call.resolveMethod();
      if (method != null
          && method.isConstructor()
          && method.getParameterList().getParametersCount() == 0) return true;

      if (call instanceof GrConstructorCall) {
        PsiElement resolved =
            PsiImplUtil.extractUniqueResult(((GrConstructorCall) call).multiResolveClass())
                .getElement();
        if (resolved instanceof PsiClass) return true;
      }

      return false;
    }