From bcb4dcc6f586ed45ff4c5bb08786695cd0e7c7da Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Tue, 29 Jun 2010 15:07:08 +0400 Subject: [PATCH] notnull --- .../projectRoots/ex/ProjectRootContainer.java | 15 ++++++++------- .../impl/ProjectRootContainerImpl.java | 16 +++++++++------- .../projectRoots/impl/SimpleProjectRoot.java | 5 +++-- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/ex/ProjectRootContainer.java b/platform/lang-impl/src/com/intellij/openapi/projectRoots/ex/ProjectRootContainer.java index e0cb26210473..1a2a69bd1477 100644 --- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/ex/ProjectRootContainer.java +++ b/platform/lang-impl/src/com/intellij/openapi/projectRoots/ex/ProjectRootContainer.java @@ -30,20 +30,21 @@ import org.jetbrains.annotations.NotNull; public interface ProjectRootContainer { @NotNull - VirtualFile[] getRootFiles(OrderRootType type); - ProjectRoot[] getRoots(OrderRootType type); + VirtualFile[] getRootFiles(@NotNull OrderRootType type); + @NotNull ProjectRoot[] getRoots(@NotNull OrderRootType type); void startChange(); void finishChange(); - ProjectRoot addRoot(VirtualFile virtualFile, OrderRootType type); - void addRoot(ProjectRoot root, OrderRootType type); - void removeRoot(ProjectRoot root, OrderRootType type); - void removeAllRoots(OrderRootType type); + @NotNull + ProjectRoot addRoot(@NotNull VirtualFile virtualFile, @NotNull OrderRootType type); + void addRoot(@NotNull ProjectRoot root, @NotNull OrderRootType type); + void removeRoot(@NotNull ProjectRoot root, @NotNull OrderRootType type); + void removeAllRoots(@NotNull OrderRootType type); void removeAllRoots(); - void removeRoot(VirtualFile root, OrderRootType type); + void removeRoot(@NotNull VirtualFile root, @NotNull OrderRootType type); void update(); } diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/ProjectRootContainerImpl.java b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/ProjectRootContainerImpl.java index 82ad950ba239..438e458d8e6b 100644 --- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/ProjectRootContainerImpl.java +++ b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/ProjectRootContainerImpl.java @@ -62,11 +62,12 @@ public class ProjectRootContainerImpl implements JDOMExternalizable, ProjectRoot } @NotNull - public VirtualFile[] getRootFiles(OrderRootType type) { + public VirtualFile[] getRootFiles(@NotNull OrderRootType type) { return myFiles.get(type); } - public ProjectRoot[] getRoots(OrderRootType type) { + @NotNull + public ProjectRoot[] getRoots(@NotNull OrderRootType type) { return myRoots.get(type).getProjectRoots(); } @@ -116,27 +117,28 @@ public class ProjectRootContainerImpl implements JDOMExternalizable, ProjectRoot } - public void removeRoot(ProjectRoot root, OrderRootType type) { + public void removeRoot(@NotNull ProjectRoot root, @NotNull OrderRootType type) { LOG.assertTrue(myInsideChange); myRoots.get(type).remove(root); } - public ProjectRoot addRoot(VirtualFile virtualFile, OrderRootType type) { + @NotNull + public ProjectRoot addRoot(@NotNull VirtualFile virtualFile, @NotNull OrderRootType type) { LOG.assertTrue(myInsideChange); return myRoots.get(type).add(virtualFile); } - public void addRoot(ProjectRoot root, OrderRootType type) { + public void addRoot(@NotNull ProjectRoot root, @NotNull OrderRootType type) { LOG.assertTrue(myInsideChange); myRoots.get(type).add(root); } - public void removeAllRoots(OrderRootType type ) { + public void removeAllRoots(@NotNull OrderRootType type ) { LOG.assertTrue(myInsideChange); myRoots.get(type).clear(); } - public void removeRoot(VirtualFile root, OrderRootType type) { + public void removeRoot(@NotNull VirtualFile root, @NotNull OrderRootType type) { LOG.assertTrue(myInsideChange); myRoots.get(type).remove(root); } diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SimpleProjectRoot.java b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SimpleProjectRoot.java index 2a573f725796..62a0dbce48cb 100644 --- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SimpleProjectRoot.java +++ b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SimpleProjectRoot.java @@ -26,6 +26,7 @@ import com.intellij.openapi.vfs.VirtualFileManager; import com.intellij.openapi.vfs.ex.http.HttpFileSystem; import org.jdom.Element; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import java.io.File; @@ -39,12 +40,12 @@ public class SimpleProjectRoot implements ProjectRoot, JDOMExternalizable { private boolean myInitialized = false; @NonNls private static final String ATTRIBUTE_URL = "url"; - SimpleProjectRoot(VirtualFile file) { + SimpleProjectRoot(@NotNull VirtualFile file) { myFile = file; myUrl = myFile.getUrl(); } - public SimpleProjectRoot(String url) { + public SimpleProjectRoot(@NotNull String url) { myUrl = url; }