From cad71fe1cd5ad82029068dd2bda22e0eb3336399 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 20 Feb 2014 19:54:14 +0400 Subject: [PATCH] notnull --- .../impl/ClassesTreeStructureProvider.java | 6 ++++-- .../projectView/ClassNameConvertor.java | 18 +++++++++++++++++- .../projectView/ProjectViewUpdatingTest.java | 5 +++-- .../intellij/projectView/SameNamesJoiner.java | 18 +++++++++++++++++- .../ide/projectView/TreeStructureProvider.java | 6 ++++-- .../PlatformProjectViewStructureProvider.java | 6 ++++-- .../projectView/ResourceBundleGrouper.java | 6 ++++-- .../FormMergerTreeStructureProvider.java | 5 +++-- .../xslt/impl/XsltTreeStructureProvider.java | 6 ++++-- .../projectView/PyTreeStructureProvider.java | 6 ++++-- 10 files changed, 64 insertions(+), 18 deletions(-) diff --git a/java/java-impl/src/com/intellij/ide/projectView/impl/ClassesTreeStructureProvider.java b/java/java-impl/src/com/intellij/ide/projectView/impl/ClassesTreeStructureProvider.java index 518fb06fea75..7e0515726610 100644 --- a/java/java-impl/src/com/intellij/ide/projectView/impl/ClassesTreeStructureProvider.java +++ b/java/java-impl/src/com/intellij/ide/projectView/impl/ClassesTreeStructureProvider.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. @@ -29,6 +29,7 @@ import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.util.Computable; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jps.model.java.JavaModuleSourceRootTypes; @@ -42,8 +43,9 @@ public class ClassesTreeStructureProvider implements SelectableTreeStructureProv myProject = project; } + @NotNull @Override - public Collection modify(AbstractTreeNode parent, Collection children, ViewSettings settings) { + public Collection modify(@NotNull AbstractTreeNode parent, @NotNull Collection children, ViewSettings settings) { ArrayList result = new ArrayList(); for (final AbstractTreeNode child : children) { Object o = child.getValue(); diff --git a/java/java-tests/testSrc/com/intellij/projectView/ClassNameConvertor.java b/java/java-tests/testSrc/com/intellij/projectView/ClassNameConvertor.java index 65956b21a89b..b879fab12188 100644 --- a/java/java-tests/testSrc/com/intellij/projectView/ClassNameConvertor.java +++ b/java/java-tests/testSrc/com/intellij/projectView/ClassNameConvertor.java @@ -1,3 +1,18 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.projectView; import com.intellij.ide.projectView.PresentationData; @@ -23,8 +38,9 @@ class ClassNameConvertor implements TreeStructureProvider { myProject = project; } + @NotNull @Override - public Collection modify(AbstractTreeNode parent, Collection children, ViewSettings settings) { + public Collection modify(@NotNull AbstractTreeNode parent, @NotNull Collection children, ViewSettings settings) { ArrayList result = new ArrayList(); for (final AbstractTreeNode aChildren : children) { diff --git a/java/java-tests/testSrc/com/intellij/projectView/ProjectViewUpdatingTest.java b/java/java-tests/testSrc/com/intellij/projectView/ProjectViewUpdatingTest.java index dc7ab08b524b..8f95c73a6a11 100644 --- a/java/java-tests/testSrc/com/intellij/projectView/ProjectViewUpdatingTest.java +++ b/java/java-tests/testSrc/com/intellij/projectView/ProjectViewUpdatingTest.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. @@ -427,8 +427,9 @@ public class ProjectViewUpdatingTest extends BaseProjectViewTestCase { private TreeStructureProvider createWrapProvider(final NodeWrapper rootWrapper) { return new TreeStructureProvider() { + @NotNull @Override - public Collection modify(AbstractTreeNode parent, Collection children, ViewSettings settings) { + public Collection modify(@NotNull AbstractTreeNode parent, @NotNull Collection children, ViewSettings settings) { if (parent instanceof NodeWrapper) { return children; diff --git a/java/java-tests/testSrc/com/intellij/projectView/SameNamesJoiner.java b/java/java-tests/testSrc/com/intellij/projectView/SameNamesJoiner.java index a9efd3480a30..7b976f28b24d 100644 --- a/java/java-tests/testSrc/com/intellij/projectView/SameNamesJoiner.java +++ b/java/java-tests/testSrc/com/intellij/projectView/SameNamesJoiner.java @@ -1,3 +1,18 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.projectView; import com.intellij.ide.projectView.PresentationData; @@ -17,8 +32,9 @@ import java.util.Collection; import java.util.Iterator; class SameNamesJoiner implements TreeStructureProvider { + @NotNull @Override - public Collection modify(AbstractTreeNode parent, Collection children, ViewSettings settings) { + public Collection modify(@NotNull AbstractTreeNode parent, @NotNull Collection children, ViewSettings settings) { if (parent instanceof JoinedNode) return children; ArrayList result = new ArrayList(); diff --git a/platform/lang-api/src/com/intellij/ide/projectView/TreeStructureProvider.java b/platform/lang-api/src/com/intellij/ide/projectView/TreeStructureProvider.java index 0ecf0f2c90ef..315a41ec6a81 100644 --- a/platform/lang-api/src/com/intellij/ide/projectView/TreeStructureProvider.java +++ b/platform/lang-api/src/com/intellij/ide/projectView/TreeStructureProvider.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. @@ -17,6 +17,7 @@ package com.intellij.ide.projectView; import com.intellij.ide.util.treeView.AbstractTreeNode; import com.intellij.openapi.extensions.ExtensionPointName; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Collection; @@ -38,7 +39,8 @@ public interface TreeStructureProvider { * @return the modified collection of child nodes, or children if no modifications * are required. */ - Collection modify(AbstractTreeNode parent, Collection children, ViewSettings settings); + @NotNull + Collection modify(@NotNull AbstractTreeNode parent, @NotNull Collection children, ViewSettings settings); /** * Returns a user data object of the specified type for the specified selection in the diff --git a/platform/lang-impl/src/com/intellij/platform/PlatformProjectViewStructureProvider.java b/platform/lang-impl/src/com/intellij/platform/PlatformProjectViewStructureProvider.java index d0cccf1844f7..ab08ce6d9091 100644 --- a/platform/lang-impl/src/com/intellij/platform/PlatformProjectViewStructureProvider.java +++ b/platform/lang-impl/src/com/intellij/platform/PlatformProjectViewStructureProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 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. @@ -27,6 +27,7 @@ import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiDirectory; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.Collection; @@ -41,8 +42,9 @@ public class PlatformProjectViewStructureProvider implements TreeStructureProvid myProject = project; } + @NotNull @Override - public Collection modify(final AbstractTreeNode parent, final Collection children, final ViewSettings settings) { + public Collection modify(@NotNull final AbstractTreeNode parent, @NotNull final Collection children, final ViewSettings settings) { if (parent instanceof PsiDirectoryNode) { final VirtualFile vFile = ((PsiDirectoryNode)parent).getVirtualFile(); if (vFile != null && Comparing.equal(ProjectFileIndex.SERVICE.getInstance(myProject).getContentRootForFile(vFile), vFile)) { diff --git a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleGrouper.java b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleGrouper.java index 3394011ab309..fca0b172c561 100644 --- a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleGrouper.java +++ b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleGrouper.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. @@ -29,6 +29,7 @@ import com.intellij.openapi.util.Computable; import com.intellij.psi.PsiFile; import com.intellij.util.SmartList; import gnu.trove.THashMap; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.Collection; @@ -42,7 +43,8 @@ public class ResourceBundleGrouper implements TreeStructureProvider, DumbAware { myProject = project; } - public Collection modify(AbstractTreeNode parent, final Collection children, final ViewSettings settings) { + @NotNull + public Collection modify(@NotNull AbstractTreeNode parent, @NotNull final Collection children, final ViewSettings settings) { if (parent instanceof ResourceBundleNode) return children; return ApplicationManager.getApplication().runReadAction(new Computable>() { diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/projectView/FormMergerTreeStructureProvider.java b/plugins/ui-designer/src/com/intellij/uiDesigner/projectView/FormMergerTreeStructureProvider.java index 5c6786eaaa76..aed97d66243d 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/projectView/FormMergerTreeStructureProvider.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/projectView/FormMergerTreeStructureProvider.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. @@ -43,7 +43,8 @@ public class FormMergerTreeStructureProvider implements TreeStructureProvider { myProject = project; } - public Collection modify(AbstractTreeNode parent, Collection children, ViewSettings settings) { + @NotNull + public Collection modify(@NotNull AbstractTreeNode parent, @NotNull Collection children, ViewSettings settings) { if (parent.getValue() instanceof Form) return children; // Optimization. Check if there are any forms at all. diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltTreeStructureProvider.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltTreeStructureProvider.java index 5bb3a31cff75..78dd117627a4 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltTreeStructureProvider.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltTreeStructureProvider.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. @@ -28,6 +28,7 @@ import icons.XpathIcons; import org.intellij.lang.xpath.xslt.XsltConfig; import org.intellij.lang.xpath.xslt.XsltSupport; import org.intellij.lang.xpath.xslt.associations.FileAssociationsManager; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -43,8 +44,9 @@ public class XsltTreeStructureProvider implements TreeStructureProvider { myProject = project; } + @NotNull @SuppressWarnings({"RawUseOfParameterizedType", "unchecked"}) - public Collection modify(AbstractTreeNode parent, Collection children, ViewSettings settings) { + public Collection modify(@NotNull AbstractTreeNode parent, @NotNull Collection children, ViewSettings settings) { Collection l = children; int i = 0; for (AbstractTreeNode o : children) { diff --git a/python/src/com/jetbrains/python/projectView/PyTreeStructureProvider.java b/python/src/com/jetbrains/python/projectView/PyTreeStructureProvider.java index ae923ed2d7e8..cb9e2577e1f8 100644 --- a/python/src/com/jetbrains/python/projectView/PyTreeStructureProvider.java +++ b/python/src/com/jetbrains/python/projectView/PyTreeStructureProvider.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. @@ -32,6 +32,7 @@ import com.jetbrains.python.psi.PyDocStringOwner; import com.jetbrains.python.psi.PyFile; import com.jetbrains.python.psi.PyFunction; import com.jetbrains.python.sdk.PythonSdkType; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.Collection; @@ -41,8 +42,9 @@ import java.util.List; * @author yole */ public class PyTreeStructureProvider implements SelectableTreeStructureProvider, DumbAware { + @NotNull @Override - public Collection modify(AbstractTreeNode parent, Collection children, ViewSettings settings) { + public Collection modify(@NotNull AbstractTreeNode parent, @NotNull Collection children, ViewSettings settings) { if (parent instanceof NamedLibraryElementNode) { return hideSkeletons((NamedLibraryElementNode)parent, children); }