diff --git a/java/java-psi-api/src/com/intellij/psi/search/searches/SuperMethodsSearch.java b/java/java-psi-api/src/com/intellij/psi/search/searches/SuperMethodsSearch.java index 877094929876..dba92bebcb65 100644 --- a/java/java-psi-api/src/com/intellij/psi/search/searches/SuperMethodsSearch.java +++ b/java/java-psi-api/src/com/intellij/psi/search/searches/SuperMethodsSearch.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -22,6 +22,7 @@ import com.intellij.psi.util.MethodSignatureBackedByPsiMethod; import com.intellij.psi.util.MethodSignatureUtil; import com.intellij.util.Query; import com.intellij.util.QueryExecutor; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** @@ -38,8 +39,8 @@ public class SuperMethodsSearch extends ExtensibleQueryFactory search(final PsiMethod derivedMethod, @Nullable final PsiClass psiClass, boolean checkBases, boolean allowStaticMethod) { + @NotNull + public static Query search(@NotNull PsiMethod derivedMethod, + @Nullable final PsiClass psiClass, + boolean checkBases, + boolean allowStaticMethod) { final SearchParameters parameters = new SearchParameters(derivedMethod, psiClass, checkBases, allowStaticMethod); return SUPER_METHODS_SEARCH_INSTANCE.createUniqueResultsQuery(parameters, MethodSignatureUtil.METHOD_BASED_HASHING_STRATEGY); } diff --git a/java/java-psi-api/src/com/intellij/psi/util/MethodSignatureBackedByPsiMethod.java b/java/java-psi-api/src/com/intellij/psi/util/MethodSignatureBackedByPsiMethod.java index adc9306ec962..5d11f1fb5005 100644 --- a/java/java-psi-api/src/com/intellij/psi/util/MethodSignatureBackedByPsiMethod.java +++ b/java/java-psi-api/src/com/intellij/psi/util/MethodSignatureBackedByPsiMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -66,10 +66,12 @@ public class MethodSignatureBackedByPsiMethod extends MethodSignatureBase { return myMethod; } + @NotNull public static MethodSignatureBackedByPsiMethod create(@NotNull PsiMethod method, @NotNull PsiSubstitutor substitutor) { return create(method, substitutor, PsiUtil.isRawSubstitutor(method, substitutor)); } + @NotNull public static MethodSignatureBackedByPsiMethod create(@NotNull PsiMethod method, @NotNull PsiSubstitutor substitutor, boolean isRaw) { PsiTypeParameter[] methodTypeParameters = method.getTypeParameters(); if (isRaw) { diff --git a/platform/core-api/src/com/intellij/util/QueryFactory.java b/platform/core-api/src/com/intellij/util/QueryFactory.java index 80155a51fa08..e00f61cdc4e6 100644 --- a/platform/core-api/src/com/intellij/util/QueryFactory.java +++ b/platform/core-api/src/com/intellij/util/QueryFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -57,6 +57,7 @@ public class QueryFactory { * @param parameters of the search * @return query to perform the search. Obtained results are automatically filtered wrt. equals() relation. */ + @NotNull public final Query createUniqueResultsQuery(@NotNull Parameters parameters) { return new UniqueResultsQuery(createQuery(parameters)); } @@ -66,6 +67,7 @@ public class QueryFactory { * @param hashingStrategy strategy to factor results * @return query to perform the search. Obtained results are automatically filtered wrt. equals() relation. */ + @NotNull public final Query createUniqueResultsQuery(@NotNull Parameters parameters, @NotNull TObjectHashingStrategy hashingStrategy) { return new UniqueResultsQuery(createQuery(parameters), hashingStrategy); @@ -78,6 +80,7 @@ public class QueryFactory { * @return query to perform the search. Obtained results are mapped to whatever objects that are automatically filtered wrt. equals() * relation. Storing mapped objects instead of original elements may be wise wrt to memory consumption. */ + @NotNull public final Query createUniqueResultsQuery(@NotNull Parameters parameters, @NotNull TObjectHashingStrategy hashingStrategy, @NotNull Function mapper) {