From d0d1809f937480e962f6012b5a2e2a59e51cbbaf Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Thu, 8 Oct 2009 16:21:38 +0400 Subject: [PATCH] Changing preconditions order may have significant performance implications. --- .../plugins/groovy/lang/psi/util/GroovyPropertyUtils.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GroovyPropertyUtils.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GroovyPropertyUtils.java index 627fff57fad9..ee137adb1d16 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GroovyPropertyUtils.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GroovyPropertyUtils.java @@ -94,10 +94,8 @@ public class GroovyPropertyUtils { public static boolean isSimplePropertyGetter(PsiMethod method, String propertyName) { if (method == null || method.isConstructor()) return false; if (method.getParameterList().getParametersCount() != 0) return false; - final PsiType type = method.getReturnType(); - if (type != null && type == PsiType.VOID) return false; if (!isGetterName(method.getName())) return false; - return propertyName == null || propertyName.equals(getPropertyNameByGetter(method)); + return (propertyName == null || propertyName.equals(getPropertyNameByGetter(method))) && method.getReturnType() != PsiType.VOID; } public static boolean isSimplePropertySetter(PsiMethod method) {