Minor, encapsulate logic

This commit is contained in:
Alexander Udalov
2013-08-06 18:18:18 +04:00
parent 517567fd24
commit 45346071a3
2 changed files with 3 additions and 7 deletions
@@ -162,7 +162,7 @@ public final class JavaConstructorResolver {
Collections.<AnnotationDescriptor>emptyList(),
method.getName(),
typeTransformer.transformToType(returnType, typeVariableResolver),
method.getAnnotationParameterDefaultValue() != null,
method.hasAnnotationParameterDefaultValue(),
varargElementType));
index++;
@@ -56,13 +56,9 @@ public class JavaMethod extends JavaMemberImpl implements JavaTypeParameterListO
return valueParameters(getPsi().getParameterList().getParameters());
}
@Nullable
public Object getAnnotationParameterDefaultValue() {
public boolean hasAnnotationParameterDefaultValue() {
PsiMethod psiMethod = getPsi();
if (psiMethod instanceof PsiAnnotationMethod) {
return ((PsiAnnotationMethod) psiMethod).getDefaultValue();
}
return null;
return psiMethod instanceof PsiAnnotationMethod && ((PsiAnnotationMethod) psiMethod).getDefaultValue() != null;
}
@Nullable