mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
@NotNull
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ public class JavaAnnotationIndex extends StringStubIndexExtension<PsiAnnotation>
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PsiAnnotation> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
public Collection<PsiAnnotation> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiAnnotation.class);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -45,7 +45,7 @@ public class JavaAnonymousClassBaseRefOccurenceIndex extends StringStubIndexExte
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PsiAnonymousClass> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
public Collection<PsiAnonymousClass> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiAnonymousClass.class);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class JavaFieldNameIndex extends StringStubIndexExtension<PsiField> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PsiField> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
public Collection<PsiField> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiField.class);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class JavaFullClassNameIndex extends IntStubIndexExtension<PsiClass> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PsiClass> get(final Integer integer, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
public Collection<PsiClass> get(@NotNull final Integer integer, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(getKey(), integer, project, new JavaSourceFilterScope(scope), PsiClass.class);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class JavaMethodNameIndex extends StringStubIndexExtension<PsiMethod> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PsiMethod> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
public Collection<PsiMethod> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiMethod.class);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class JavaMethodParameterTypesIndex extends StringStubIndexExtension<PsiM
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PsiMethod> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
public Collection<PsiMethod> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiMethod.class);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -51,7 +51,7 @@ public class JavaShortClassNameIndex extends StringStubIndexExtension<PsiClass>
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PsiClass> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
public Collection<PsiClass> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiClass.class);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ public class JavaSuperClassNameOccurenceIndex extends StringStubIndexExtension<P
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PsiReferenceList> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
public Collection<PsiReferenceList> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiReferenceList.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.util.Processor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -34,7 +35,7 @@ public abstract class AbstractStubIndex<Key, Psi extends PsiElement> implements
|
||||
return StubIndex.getInstance().processAllKeys(getKey(), project, processor);
|
||||
}
|
||||
|
||||
public Collection<Psi> get(Key key, final Project project, final GlobalSearchScope scope) {
|
||||
public Collection<Psi> get(@NotNull Key key, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return StubIndex.getInstance().get(getKey(), key, project, scope);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.indexing.FileBasedIndex;
|
||||
import com.intellij.util.indexing.IdFilter;
|
||||
@@ -51,7 +52,7 @@ public abstract class StubIndex {
|
||||
public abstract <Key, Psi extends PsiElement> Collection<Psi> get(@NotNull StubIndexKey<Key, Psi> indexKey,
|
||||
@NotNull Key key,
|
||||
@NotNull Project project,
|
||||
final GlobalSearchScope scope);
|
||||
@NotNull final GlobalSearchScope scope);
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #getElements(StubIndexKey, Object, com.intellij.openapi.project.Project, com.intellij.psi.search.GlobalSearchScope, Class)}
|
||||
@@ -59,7 +60,7 @@ public abstract class StubIndex {
|
||||
public <Key, Psi extends PsiElement> Collection<Psi> get(@NotNull StubIndexKey<Key, Psi> indexKey,
|
||||
@NotNull Key key,
|
||||
@NotNull Project project,
|
||||
final GlobalSearchScope scope,
|
||||
@NotNull final GlobalSearchScope scope,
|
||||
IdFilter filter) {
|
||||
return get(indexKey, key, project, scope);
|
||||
}
|
||||
@@ -70,7 +71,7 @@ public abstract class StubIndex {
|
||||
public <Key, Psi extends PsiElement> boolean process(@NotNull StubIndexKey<Key, Psi> indexKey,
|
||||
@NotNull Key key,
|
||||
@NotNull Project project,
|
||||
GlobalSearchScope scope,
|
||||
@NotNull GlobalSearchScope scope,
|
||||
@NotNull Processor<? super Psi> processor) {
|
||||
return processElements(indexKey, key, project, scope, (Class<Psi>)PsiElement.class, processor);
|
||||
}
|
||||
@@ -78,7 +79,7 @@ public abstract class StubIndex {
|
||||
public abstract <Key, Psi extends PsiElement> boolean processElements(@NotNull StubIndexKey<Key, Psi> indexKey,
|
||||
@NotNull Key key,
|
||||
@NotNull Project project,
|
||||
GlobalSearchScope scope,
|
||||
@Nullable GlobalSearchScope scope,
|
||||
Class<Psi> requiredClass,
|
||||
@NotNull Processor<? super Psi> processor);
|
||||
|
||||
@@ -88,8 +89,8 @@ public abstract class StubIndex {
|
||||
public <Key, Psi extends PsiElement> boolean process(@NotNull StubIndexKey<Key, Psi> indexKey,
|
||||
@NotNull Key key,
|
||||
@NotNull Project project,
|
||||
GlobalSearchScope scope,
|
||||
IdFilter idFilter,
|
||||
@NotNull GlobalSearchScope scope,
|
||||
@SuppressWarnings("UnusedParameters") IdFilter idFilter,
|
||||
@NotNull Processor<? super Psi> processor) {
|
||||
return process(indexKey, key, project, scope, processor);
|
||||
}
|
||||
@@ -97,9 +98,9 @@ public abstract class StubIndex {
|
||||
public <Key, Psi extends PsiElement> boolean processElements(@NotNull StubIndexKey<Key, Psi> indexKey,
|
||||
@NotNull Key key,
|
||||
@NotNull Project project,
|
||||
GlobalSearchScope scope,
|
||||
@NotNull GlobalSearchScope scope,
|
||||
IdFilter idFilter,
|
||||
Class<Psi> requiredClass,
|
||||
@NotNull Class<Psi> requiredClass,
|
||||
@NotNull Processor<? super Psi> processor) {
|
||||
return process(indexKey, key, project, scope, processor);
|
||||
}
|
||||
@@ -109,8 +110,9 @@ public abstract class StubIndex {
|
||||
|
||||
public abstract <K> boolean processAllKeys(@NotNull StubIndexKey<K, ?> indexKey, @NotNull Project project, Processor<K> processor);
|
||||
|
||||
public <K> boolean processAllKeys(@NotNull StubIndexKey<K, ?> indexKey, Processor<K> processor, GlobalSearchScope scope, @Nullable IdFilter idFilter) {
|
||||
return processAllKeys(indexKey, scope.getProject(), processor);
|
||||
public <K> boolean processAllKeys(@NotNull StubIndexKey<K, ?> indexKey, @NotNull Processor<K> processor,
|
||||
@NotNull GlobalSearchScope scope, @Nullable IdFilter idFilter) {
|
||||
return processAllKeys(indexKey, ObjectUtils.assertNotNull(scope.getProject()), processor);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,11 +32,19 @@ public abstract class StubProcessingHelperBase {
|
||||
return stub.getStubType();
|
||||
}
|
||||
|
||||
public <Psi extends PsiElement> boolean processStubsInFile(final Project project, final VirtualFile file, StubIdList value, final Processor<? super Psi> processor, Class<Psi> requiredClass) {
|
||||
public <Psi extends PsiElement> boolean processStubsInFile(@NotNull final Project project,
|
||||
@NotNull final VirtualFile file,
|
||||
@NotNull StubIdList value,
|
||||
@NotNull final Processor<? super Psi> processor,
|
||||
@NotNull Class<Psi> requiredClass) {
|
||||
return processStubsInFile(project, file, value, processor, requiredClass, false);
|
||||
}
|
||||
|
||||
public <Psi extends PsiElement> boolean processStubsInFile(final Project project, final VirtualFile file, StubIdList value, final Processor<? super Psi> processor, Class<Psi> requiredClass, final boolean skipOnErrors) {
|
||||
public <Psi extends PsiElement> boolean processStubsInFile(@NotNull final Project project,
|
||||
@NotNull final VirtualFile file,
|
||||
@NotNull StubIdList value,
|
||||
@NotNull final Processor<? super Psi> processor,
|
||||
@NotNull Class<Psi> requiredClass, final boolean skipOnErrors) {
|
||||
StubTree stubTree = null;
|
||||
|
||||
PsiFile candidatePsiFile = PsiManager.getInstance(project).findFile(file);
|
||||
|
||||
@@ -207,7 +207,7 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe
|
||||
public <Key, Psi extends PsiElement> Collection<Psi> get(@NotNull final StubIndexKey<Key, Psi> indexKey,
|
||||
@NotNull final Key key,
|
||||
@NotNull final Project project,
|
||||
final GlobalSearchScope scope) {
|
||||
@NotNull final GlobalSearchScope scope) {
|
||||
return get(indexKey, key, project, scope, null);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe
|
||||
public <Key, Psi extends PsiElement> Collection<Psi> get(@NotNull StubIndexKey<Key, Psi> indexKey,
|
||||
@NotNull Key key,
|
||||
@NotNull Project project,
|
||||
GlobalSearchScope scope,
|
||||
@NotNull GlobalSearchScope scope,
|
||||
IdFilter filter) {
|
||||
final List<Psi> result = new SmartList<Psi>();
|
||||
process(indexKey, key, project, scope, filter, new CommonProcessors.CollectProcessor<Psi>(result));
|
||||
@@ -226,7 +226,7 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe
|
||||
public <Key, Psi extends PsiElement> boolean processElements(@NotNull StubIndexKey<Key, Psi> indexKey,
|
||||
@NotNull Key key,
|
||||
@NotNull Project project,
|
||||
GlobalSearchScope scope,
|
||||
@Nullable GlobalSearchScope scope,
|
||||
Class<Psi> requiredClass,
|
||||
@NotNull Processor<? super Psi> processor) {
|
||||
return processElements(indexKey, key, project, scope, null, requiredClass, processor);
|
||||
@@ -238,7 +238,7 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe
|
||||
@NotNull final Project project,
|
||||
@Nullable final GlobalSearchScope scope,
|
||||
@Nullable IdFilter idFilter,
|
||||
final Class<Psi> requiredClass,
|
||||
@NotNull final Class<Psi> requiredClass,
|
||||
@NotNull final Processor<? super Psi> processor) {
|
||||
final FileBasedIndexImpl fileBasedIndex = (FileBasedIndexImpl)FileBasedIndex.getInstance();
|
||||
fileBasedIndex.ensureUpToDate(StubUpdatingIndex.INDEX_ID, project, scope);
|
||||
@@ -315,7 +315,7 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe
|
||||
return processAllKeys(indexKey, processor, GlobalSearchScope.allScope(project), null);
|
||||
}
|
||||
|
||||
public <K> boolean processAllKeys(@NotNull StubIndexKey<K, ?> indexKey, Processor<K> processor, GlobalSearchScope scope, @Nullable IdFilter idFilter) {
|
||||
public <K> boolean processAllKeys(@NotNull StubIndexKey<K, ?> indexKey, @NotNull Processor<K> processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter idFilter) {
|
||||
|
||||
FileBasedIndex.getInstance().ensureUpToDate(StubUpdatingIndex.INDEX_ID, scope.getProject(), scope);
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class GrFullClassNameIndex extends IntStubIndexExtension<PsiClass> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PsiClass> get(final Integer integer, final Project project, final GlobalSearchScope scope) {
|
||||
public Collection<PsiClass> get(@NotNull final Integer integer, @NotNull final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(getKey(), integer, project, new GrSourceFilterScope(scope), PsiClass.class);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -28,13 +28,14 @@ import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.indexing.FileBasedIndex;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
@@ -91,7 +92,7 @@ public class PropertiesImplUtil extends PropertiesUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static List<IProperty> findPropertiesByKey(final Project project, final String key) {
|
||||
public static List<IProperty> findPropertiesByKey(@NotNull final Project project, @NotNull final String key) {
|
||||
final GlobalSearchScope scope = GlobalSearchScope.allScope(project);
|
||||
final ArrayList<IProperty> properties =
|
||||
new ArrayList<IProperty>(PropertyKeyIndex.getInstance().get(key, project, scope));
|
||||
|
||||
Reference in New Issue
Block a user