From cde26d662e7259a57634749abd73eb7de075761f Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Sun, 17 Jul 2016 23:53:06 +0200 Subject: [PATCH] fix annotation, add @Contract --- .../src/com/intellij/psi/util/PropertyUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java/java-psi-api/src/com/intellij/psi/util/PropertyUtil.java b/java/java-psi-api/src/com/intellij/psi/util/PropertyUtil.java index 38f44262e062..81f530496307 100644 --- a/java/java-psi-api/src/com/intellij/psi/util/PropertyUtil.java +++ b/java/java-psi-api/src/com/intellij/psi/util/PropertyUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import com.intellij.psi.codeStyle.VariableKind; import com.intellij.util.ArrayUtil; import com.intellij.util.IncorrectOperationException; import com.intellij.util.containers.ContainerUtil; +import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -44,7 +45,8 @@ public class PropertyUtil { private PropertyUtil() { } - public static boolean isSimplePropertyGetter(@NotNull PsiMethod method) { + @Contract("null -> false") + public static boolean isSimplePropertyGetter(@Nullable PsiMethod method) { return hasGetterName(method) && method.getParameterList().getParametersCount() == 0; }