mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
notnull
This commit is contained in:
@@ -76,10 +76,11 @@ public class GlobalSearchScopes {
|
||||
|
||||
@Override
|
||||
public boolean contains(VirtualFile file) {
|
||||
NamedScopesHolder holder = NamedScopeManager.getInstance(getProject());
|
||||
Project project = getProject();
|
||||
NamedScopesHolder holder = NamedScopeManager.getInstance(project);
|
||||
final PackageSet packageSet = mySet.getValue();
|
||||
if (packageSet != null) {
|
||||
if (packageSet instanceof PackageSetBase) return ((PackageSetBase)packageSet).contains(file, getProject(), holder);
|
||||
if (packageSet instanceof PackageSetBase) return ((PackageSetBase)packageSet).contains(file, project, holder);
|
||||
PsiFile psiFile = myManager.findFile(file);
|
||||
return psiFile != null && packageSet.contains(psiFile, holder);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.search.scope.packageSet.AbstractPackageSet;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScope;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScopesHolder;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
@@ -37,7 +38,7 @@ public class ProjectFilesScope extends NamedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(VirtualFile file, Project project, @Nullable NamedScopesHolder holder) {
|
||||
public boolean contains(VirtualFile file, @NotNull Project project, @Nullable NamedScopesHolder holder) {
|
||||
if (file == null) return false;
|
||||
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
|
||||
return holder.getProject().isInitialized()
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.search.scope.packageSet.AbstractPackageSet;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScope;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScopesHolder;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
@@ -37,7 +38,7 @@ public class ProjectProductionScope extends NamedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(VirtualFile file, Project project, @Nullable NamedScopesHolder holder) {
|
||||
public boolean contains(VirtualFile file, @NotNull Project project, @Nullable NamedScopesHolder holder) {
|
||||
final ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex();
|
||||
return file != null
|
||||
&& !index.isInTestSourceContent(file)
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.intellij.psi.search.scope.packageSet.AbstractPackageSet;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScope;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScopesHolder;
|
||||
import com.intellij.ui.Colored;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
@@ -41,7 +42,7 @@ public class TestsScope extends NamedScope {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(VirtualFile file, Project project, @Nullable NamedScopesHolder holder) {
|
||||
public boolean contains(VirtualFile file, @NotNull Project project, @Nullable NamedScopesHolder holder) {
|
||||
final ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex();
|
||||
return file != null && index.isInTestSourceContent(file);
|
||||
}
|
||||
|
||||
+4
-3
@@ -40,7 +40,7 @@ public abstract class NamedScopesHolder implements PersistentStateComponent<Elem
|
||||
protected final Project myProject;
|
||||
private VirtualFile myProjectBaseDir;
|
||||
|
||||
public NamedScopesHolder(final Project project) {
|
||||
public NamedScopesHolder(@NotNull Project project) {
|
||||
myProject = project;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public abstract class NamedScopesHolder implements PersistentStateComponent<Elem
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static NamedScope getScope(final Project project, final String scopeName) {
|
||||
public static NamedScope getScope(@NotNull Project project, final String scopeName) {
|
||||
final NamedScopesHolder[] holders = getAllNamedScopeHolders(project);
|
||||
for (NamedScopesHolder holder : holders) {
|
||||
final NamedScope scope = holder.getScope(scopeName);
|
||||
@@ -112,7 +112,7 @@ public abstract class NamedScopesHolder implements PersistentStateComponent<Elem
|
||||
return null;
|
||||
}
|
||||
|
||||
public static NamedScopesHolder[] getAllNamedScopeHolders(final Project project) {
|
||||
public static NamedScopesHolder[] getAllNamedScopeHolders(@NotNull Project project) {
|
||||
NamedScopesHolder[] holders = new NamedScopesHolder[2];
|
||||
holders [0] = NamedScopeManager.getInstance(project);
|
||||
holders [1] = DependencyValidationManager.getInstance(project);
|
||||
@@ -190,6 +190,7 @@ public abstract class NamedScopesHolder implements PersistentStateComponent<Elem
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
+2
-1
@@ -79,6 +79,7 @@ import java.util.Map;
|
||||
public abstract class AbstractProjectViewPane implements DataProvider, Disposable, BusyObject {
|
||||
public static ExtensionPointName<AbstractProjectViewPane> EP_NAME = ExtensionPointName.create("com.intellij.projectViewPane");
|
||||
|
||||
@NotNull
|
||||
protected final Project myProject;
|
||||
private Runnable myTreeChangeListener;
|
||||
protected DnDAwareTree myTree;
|
||||
@@ -102,7 +103,7 @@ public abstract class AbstractProjectViewPane implements DataProvider, Disposabl
|
||||
}
|
||||
}
|
||||
|
||||
protected AbstractProjectViewPane(Project project) {
|
||||
protected AbstractProjectViewPane(@NotNull Project project) {
|
||||
myProject = project;
|
||||
WolfTheProblemSolver.ProblemListener problemListener = new WolfTheProblemSolver.ProblemListener() {
|
||||
@Override
|
||||
|
||||
@@ -119,6 +119,7 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable {
|
||||
FunctionUtil.<PsiElement>id());
|
||||
}
|
||||
};
|
||||
@NotNull
|
||||
private final Project myProject;
|
||||
private FileTreeModelBuilder myBuilder;
|
||||
|
||||
@@ -170,7 +171,7 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable {
|
||||
private ScopeTreeViewPanel.MyChangesListListener myChangesListListener = new MyChangesListListener();
|
||||
protected ActionCallback myActionCallback;
|
||||
|
||||
public ScopeTreeViewPanel(final Project project) {
|
||||
public ScopeTreeViewPanel(@NotNull Project project) {
|
||||
super(new BorderLayout());
|
||||
myUpdateQueue.setPassThrough(false); // we don't want passthrough mode, even in unit tests
|
||||
myProject = project;
|
||||
|
||||
@@ -86,7 +86,7 @@ public class ScopeEditorPanel {
|
||||
private PanelProgressIndicator myCurrentProgress;
|
||||
private NamedScopesHolder myHolder;
|
||||
|
||||
public ScopeEditorPanel(final Project project, final NamedScopesHolder holder) {
|
||||
public ScopeEditorPanel(@NotNull final Project project, final NamedScopesHolder holder) {
|
||||
myProject = project;
|
||||
myHolder = holder;
|
||||
|
||||
|
||||
@@ -18,11 +18,12 @@ package com.intellij.packageDependencies.ui;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class RootNode extends PackageDependenciesNode {
|
||||
public RootNode(Project project) {
|
||||
public RootNode(@NotNull Project project) {
|
||||
super(project);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ public class FileColorsModel implements Cloneable {
|
||||
globalScopesColors = new HashMap<String, String>();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private final Project myProject;
|
||||
|
||||
FileColorsModel(@NotNull final Project project) {
|
||||
|
||||
@@ -42,6 +42,7 @@ import java.util.Map;
|
||||
public abstract class FileOrDirectoryTreeNode extends AbstractTreeNode implements VirtualFilePointerListener, Disposable {
|
||||
private static final Map<FileStatus, SimpleTextAttributes> myFileStatusToAttributeMap = new HashMap<FileStatus, SimpleTextAttributes>();
|
||||
private final SimpleTextAttributes myInvalidAttributes;
|
||||
@NotNull
|
||||
private final Project myProject;
|
||||
protected final File myFile;
|
||||
private final String myName;
|
||||
@@ -140,6 +141,7 @@ public abstract class FileOrDirectoryTreeNode extends AbstractTreeNode implement
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user