@NotNull public static PsiMethod[] getConstructors(@NotNull PsiClass aClass) { List<PsiMethod> result = null; for (PsiMethod method : aClass.getMethods()) { if (method.isConstructor()) { if (result == null) result = ContainerUtil.newSmartList(); result.add(method); } } return result == null ? PsiMethod.EMPTY_ARRAY : result.toArray(new PsiMethod[result.size()]); }
public static boolean processDeclarationsInMethod( @NotNull final PsiMethod method, @NotNull final PsiScopeProcessor processor, @NotNull final ResolveState state, final PsiElement lastParent, @NotNull final PsiElement place) { final boolean fromBody = lastParent instanceof PsiCodeBlock; final PsiTypeParameterList typeParameterList = method.getTypeParameterList(); return processDeclarationsInMethodLike( method, processor, state, place, fromBody, typeParameterList); }
public static boolean isVarArgs(@NotNull PsiMethod method) { PsiParameter[] parameters = method.getParameterList().getParameters(); return parameters.length > 0 && parameters[parameters.length - 1].isVarArgs(); }