From bdc02bac80ab862665893ce2445420c06b826865 Mon Sep 17 00:00:00 2001 From: Alexander Zolotov Date: Wed, 11 Nov 2015 00:09:10 +0100 Subject: [PATCH] Revert "@NotNull/@Nullable" This reverts commit 5b2237d50c06e04bfe2e215ed3f615b6508407a7. --- src/com/goide/GoAnnotator.java | 13 ++++------- src/com/goide/GoModuleBuilder.java | 3 +-- src/com/goide/actions/GoCreateFileAction.java | 2 +- .../actions/fmt/GoDownloadableFileAction.java | 4 ++-- .../actions/fmt/GoExternalToolsAction.java | 2 +- .../goide/actions/fmt/GoTypeFileAction.java | 2 +- .../YamlFilesModificationTracker.java | 1 - .../run/GoAppEngineRunConfiguration.java | 2 +- .../GoAppEngineRunConfigurationEditor.java | 2 +- .../run/GoAppEngineRunningState.java | 1 - .../imports/GoAutoImportConfigurable.java | 10 ++++---- .../imports/GoCodeInsightSettings.java | 3 +-- .../GoExcludePathLookupActionProvider.java | 5 ++-- .../imports/GoImportOptimizer.java | 3 +-- .../GoBuildTargetConfigurable.java | 1 - .../configuration/GoConfigurableProvider.java | 3 +-- .../GoLibrariesConfigurable.java | 4 ++-- .../GoLibrariesConfigurableProvider.java | 11 ++++----- .../GoModuleEditorsProvider.java | 2 +- .../configuration/GoSdkConfigurable.java | 7 +++--- .../goide/editor/GoParameterInfoHandler.java | 1 - src/com/goide/editor/GoWordSelectioner.java | 2 +- .../editor/surround/GoSurroundDescriptor.java | 3 +-- .../settings/GoCodeStyleConfigurable.java | 4 ++-- src/com/goide/go/GoGotoContributorBase.java | 2 +- .../goide/inspections/GoDeleteQuickFix.java | 2 +- .../GoDuplicateArgumentInspection.java | 1 - .../GoDuplicateFunctionInspection.java | 2 +- .../GoDuplicateMethodInspection.java | 2 +- .../GoMultiplePackagesQuickFix.java | 2 +- .../goide/inspections/GoRenameQuickFix.java | 2 +- .../inspections/GoRenameToBlankQuickFix.java | 2 +- .../GoTestSignaturesInspection.java | 3 +-- ...atchedBuildTargetNotificationProvider.java | 2 +- .../WrongModuleTypeNotificationProvider.java | 2 +- ...gSdkConfigurationNotificationProvider.java | 2 +- .../suppression/GoInspectionSuppressor.java | 2 +- src/com/goide/parser/GoParserUtil.java | 8 +++---- .../goide/project/GoBuildTargetSettings.java | 4 +--- .../project/GoExcludedPathsSettings.java | 4 ++-- src/com/goide/project/GoLibrariesService.java | 5 ++-- .../project/GoModuleLibrariesInitializer.java | 11 ++++----- .../project/GoModuleLibrariesService.java | 2 -- src/com/goide/psi/GoFile.java | 3 +-- src/com/goide/psi/impl/GoCachedReference.java | 5 ++-- src/com/goide/psi/impl/GoElementFactory.java | 1 - src/com/goide/psi/impl/GoPsiImplUtil.java | 17 +++----------- .../goide/psi/impl/GoStubbedElementImpl.java | 6 ++--- src/com/goide/psi/impl/GoTypeReference.java | 4 ++-- src/com/goide/psi/impl/GoVarProcessor.java | 2 +- src/com/goide/psi/impl/GoVarReference.java | 4 ++-- .../impl/imports/GoFileContextProvider.java | 2 +- .../impl/imports/GoImportReferenceHelper.java | 8 +++---- .../GoImportStringManipulator.java | 2 +- .../impl/manipulator/GoStringManipulator.java | 3 +-- .../goide/refactor/GoIntroduceOperation.java | 6 ++--- .../refactor/GoIntroduceVariableBase.java | 23 +++++++++---------- .../refactor/GoIntroduceVariableDialog.java | 7 ++---- .../refactor/GoIntroduceVariableHandler.java | 2 +- .../refactor/GoRenameImportSpecProcessor.java | 2 +- src/com/goide/runconfig/GoBuildingRunner.java | 10 ++++---- .../runconfig/GoConfigurationFactoryBase.java | 5 ++-- src/com/goide/runconfig/GoConsoleFilter.java | 6 ++--- .../runconfig/GoModuleBasedConfiguration.java | 3 +-- .../runconfig/GoRunConfigurationBase.java | 4 ++-- .../runconfig/GoRunConfigurationWithMain.java | 4 ++-- src/com/goide/runconfig/GoRunUtil.java | 4 ++-- src/com/goide/runconfig/GoRunningState.java | 1 - .../GoApplicationConfiguration.java | 2 +- ...GoApplicationRunConfigurationProducer.java | 2 +- .../GoApplicationRunningState.java | 3 +-- .../before/GoBeforeRunTaskProvider.java | 16 +++++-------- .../before/GoCommandBeforeRunTask.java | 6 ++--- .../before/GoCommandConfigureDialog.java | 2 +- .../runconfig/file/GoRunFileRunningState.java | 3 +-- .../testing/GoTestRunConfiguration.java | 8 +++---- .../runconfig/testing/GoTestRunningState.java | 5 ++-- .../testing/coverage/GoCoverageAnnotator.java | 11 ++++----- .../GoCoverageEnabledConfiguration.java | 3 +-- .../testing/coverage/GoCoverageEngine.java | 8 ++----- .../coverage/GoCoverageProjectData.java | 7 ++---- .../testing/coverage/GoCoverageRunner.java | 7 ++---- .../gocheck/GocheckEventsConverter.java | 14 +++++------ .../frameworks/gocheck/GocheckFramework.java | 2 +- .../gocheck/GocheckRunningState.java | 3 +-- .../gotest/GotestEventsConverter.java | 8 +++---- .../ui/GoTestRunConfigurationEditorForm.java | 2 +- .../ui/GoRunFileConfigurationEditorForm.java | 4 ++-- ...oEnvironmentGoPathModificationTracker.java | 7 ++---- src/com/goide/sdk/GoSdkService.java | 1 - src/com/goide/sdk/GoSdkType.java | 3 +-- src/com/goide/sdk/GoSdkUtil.java | 5 ++-- .../stubs/GoAnonymousFieldDefinitionStub.java | 5 ++-- .../goide/stubs/GoConstDefinitionStub.java | 5 ++-- .../goide/stubs/GoFieldDefinitionStub.java | 5 ++-- .../GoFunctionOrMethodDeclarationStub.java | 5 ++-- src/com/goide/stubs/GoImportSpecStub.java | 2 +- .../goide/stubs/GoLabelDefinitionStub.java | 5 ++-- .../goide/stubs/GoMethodDeclarationStub.java | 2 +- src/com/goide/stubs/GoMethodSpecStub.java | 5 ++-- src/com/goide/stubs/GoNamedStub.java | 5 ++-- .../goide/stubs/GoParamDefinitionStub.java | 5 ++-- src/com/goide/stubs/GoReceiverStub.java | 5 ++-- .../goide/stubs/GoStubElementTypeFactory.java | 2 +- src/com/goide/stubs/GoTypeSpecStub.java | 5 ++-- src/com/goide/stubs/GoVarDefinitionStub.java | 5 ++-- .../types/GoConstSpecStubElementType.java | 2 +- .../goide/stubs/types/GoStubElementType.java | 2 +- .../stubs/types/GoVarSpecStubElementType.java | 2 +- src/com/goide/tree/ExportabilitySorter.java | 3 +-- src/com/goide/util/GoExecutor.java | 8 +++---- .../goide/util/GoHistoryProcessListener.java | 3 +-- .../goide/util/GoStringLiteralEscaper.java | 2 +- src/com/goide/util/GoUtil.java | 5 ++-- 114 files changed, 204 insertions(+), 301 deletions(-) diff --git a/src/com/goide/GoAnnotator.java b/src/com/goide/GoAnnotator.java index 4cbf16a45d..4d347d2bfd 100644 --- a/src/com/goide/GoAnnotator.java +++ b/src/com/goide/GoAnnotator.java @@ -121,21 +121,18 @@ else if (resolve instanceof GoParamDefinition) { } } - @NotNull - private static TextAttributesKey getColor(@NotNull GoConstDefinition o) { + private static TextAttributesKey getColor(GoConstDefinition o) { if (isPackageWide(o)) { return o.isPublic() ? PACKAGE_EXPORTED_CONSTANT : PACKAGE_LOCAL_CONSTANT; } return LOCAL_CONSTANT; } - @NotNull - private static TextAttributesKey getColor(@NotNull GoFieldDefinition o) { + private static TextAttributesKey getColor(GoFieldDefinition o) { return o.isPublic() ? STRUCT_EXPORTED_MEMBER : STRUCT_LOCAL_MEMBER; } - @NotNull - private static TextAttributesKey getColor(@NotNull GoVarDefinition o) { + private static TextAttributesKey getColor(GoVarDefinition o) { if (PsiTreeUtil.getParentOfType(o, GoForStatement.class) != null || PsiTreeUtil.getParentOfType(o, GoIfStatement.class) != null || PsiTreeUtil.getParentOfType(o, GoSwitchStatement.class) != null) { @@ -149,12 +146,10 @@ private static TextAttributesKey getColor(@NotNull GoVarDefinition o) { return LOCAL_VARIABLE; } - @NotNull - private static TextAttributesKey getColor(@NotNull GoNamedSignatureOwner o) { + private static TextAttributesKey getColor(GoNamedSignatureOwner o) { return o.isPublic() ? EXPORTED_FUNCTION : LOCAL_FUNCTION; } - @NotNull private static TextAttributesKey getColor(@Nullable GoTypeSpec o) { GoType type = o == null ? null : o.getGoType(null); if (type == null) { diff --git a/src/com/goide/GoModuleBuilder.java b/src/com/goide/GoModuleBuilder.java index dec2d88678..8803131a84 100644 --- a/src/com/goide/GoModuleBuilder.java +++ b/src/com/goide/GoModuleBuilder.java @@ -34,12 +34,11 @@ public class GoModuleBuilder extends JavaModuleBuilder implements SourcePathsBuilder, ModuleBuilderListener { @Override - public void setupRootModel(@NotNull ModifiableRootModel modifiableRootModel) throws ConfigurationException { + public void setupRootModel(ModifiableRootModel modifiableRootModel) throws ConfigurationException { addListener(this); super.setupRootModel(modifiableRootModel); } - @NotNull @Override public List> getSourcePaths() { return ContainerUtil.emptyList(); diff --git a/src/com/goide/actions/GoCreateFileAction.java b/src/com/goide/actions/GoCreateFileAction.java index debe1df1ed..cd21fe30ae 100644 --- a/src/com/goide/actions/GoCreateFileAction.java +++ b/src/com/goide/actions/GoCreateFileAction.java @@ -41,7 +41,7 @@ public class GoCreateFileAction extends CreateFileFromTemplateAction implements private static final String PACKAGE = "PACKAGE"; @Override - protected PsiFile createFile(@NotNull String name, @NotNull String templateName, @NotNull PsiDirectory dir) { + protected PsiFile createFile(String name, @NotNull String templateName, @NotNull PsiDirectory dir) { FileTemplateManager templateManager = FileTemplateManager.getInstance(dir.getProject()); FileTemplate template = templateManager.getInternalTemplate(templateName); Properties properties = templateManager.getDefaultProperties(); diff --git a/src/com/goide/actions/fmt/GoDownloadableFileAction.java b/src/com/goide/actions/fmt/GoDownloadableFileAction.java index 448f3ab6ba..0b6af7166a 100644 --- a/src/com/goide/actions/fmt/GoDownloadableFileAction.java +++ b/src/com/goide/actions/fmt/GoDownloadableFileAction.java @@ -63,8 +63,8 @@ protected VirtualFile getExecutable(@NotNull Project project, @Nullable Module m } private class MyNotificationListener implements NotificationListener { - @NotNull private final Project myProject; - @Nullable private final Module myModule; + private final Project myProject; + private final Module myModule; private MyNotificationListener(@NotNull Project project, @Nullable Module module) { myProject = project; diff --git a/src/com/goide/actions/fmt/GoExternalToolsAction.java b/src/com/goide/actions/fmt/GoExternalToolsAction.java index 306ab8a613..6506c9cfd3 100644 --- a/src/com/goide/actions/fmt/GoExternalToolsAction.java +++ b/src/com/goide/actions/fmt/GoExternalToolsAction.java @@ -62,7 +62,7 @@ public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabled(GoSdkService.getInstance(project).isGoModule(module)); } - protected boolean isAvailableOnFile(@NotNull VirtualFile file) { + protected boolean isAvailableOnFile(VirtualFile file) { return file.getFileType() == GoFileType.INSTANCE; } diff --git a/src/com/goide/actions/fmt/GoTypeFileAction.java b/src/com/goide/actions/fmt/GoTypeFileAction.java index 3da6c9e5b1..4e1554a6ad 100644 --- a/src/com/goide/actions/fmt/GoTypeFileAction.java +++ b/src/com/goide/actions/fmt/GoTypeFileAction.java @@ -29,7 +29,7 @@ public GoTypeFileAction() { } @Override - protected boolean isAvailableOnFile(@NotNull VirtualFile file) { + protected boolean isAvailableOnFile(VirtualFile file) { return super.isAvailableOnFile(file) || file.isDirectory(); } diff --git a/src/com/goide/appengine/YamlFilesModificationTracker.java b/src/com/goide/appengine/YamlFilesModificationTracker.java index d74ae401ba..1d14aefd05 100644 --- a/src/com/goide/appengine/YamlFilesModificationTracker.java +++ b/src/com/goide/appengine/YamlFilesModificationTracker.java @@ -79,7 +79,6 @@ public static Collection getYamlFiles(@NotNull final Project projec @Override public Result> compute() { Collection yamlFiles = ApplicationManager.getApplication().runReadAction(new Computable>() { - @NotNull @Override public Collection compute() { GlobalSearchScope scope = module != null ? GoUtil.moduleScopeWithoutLibraries(module) : GlobalSearchScope.projectScope(project); diff --git a/src/com/goide/appengine/run/GoAppEngineRunConfiguration.java b/src/com/goide/appengine/run/GoAppEngineRunConfiguration.java index f22d37ff6c..29c14b63c2 100644 --- a/src/com/goide/appengine/run/GoAppEngineRunConfiguration.java +++ b/src/com/goide/appengine/run/GoAppEngineRunConfiguration.java @@ -94,7 +94,7 @@ public void readExternal(@NotNull Element element) throws InvalidDataException { } @Override - public void writeExternal(@NotNull Element element) throws WriteExternalException { + public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); if (StringUtil.isNotEmpty(myHost)) { JDOMExternalizerUtil.addElementWithValueAttribute(element, HOST_NAME, myHost); diff --git a/src/com/goide/appengine/run/GoAppEngineRunConfigurationEditor.java b/src/com/goide/appengine/run/GoAppEngineRunConfigurationEditor.java index 82bd06f4d5..d29600ed5b 100644 --- a/src/com/goide/appengine/run/GoAppEngineRunConfigurationEditor.java +++ b/src/com/goide/appengine/run/GoAppEngineRunConfigurationEditor.java @@ -79,7 +79,7 @@ protected void disposeEditor() { private void initConfigFileField(@NotNull Project project) { GoRunUtil.installFileChooser(project, myConfigFileField, false, false, new Condition() { @Override - public boolean value(@NotNull VirtualFile file) { + public boolean value(VirtualFile file) { return "yaml".equals(file.getExtension()); } }); diff --git a/src/com/goide/appengine/run/GoAppEngineRunningState.java b/src/com/goide/appengine/run/GoAppEngineRunningState.java index 8da6aea05c..5a4e674b96 100644 --- a/src/com/goide/appengine/run/GoAppEngineRunningState.java +++ b/src/com/goide/appengine/run/GoAppEngineRunningState.java @@ -31,7 +31,6 @@ public GoAppEngineRunningState(@NotNull ExecutionEnvironment env, super(env, module, configuration); } - @NotNull @Override protected GoExecutor patchExecutor(@NotNull GoExecutor executor) throws ExecutionException { executor.withParameters("serve"); diff --git a/src/com/goide/codeInsight/imports/GoAutoImportConfigurable.java b/src/com/goide/codeInsight/imports/GoAutoImportConfigurable.java index 1c5f36ba0c..143941ea18 100644 --- a/src/com/goide/codeInsight/imports/GoAutoImportConfigurable.java +++ b/src/com/goide/codeInsight/imports/GoAutoImportConfigurable.java @@ -36,10 +36,10 @@ import java.util.Arrays; public class GoAutoImportConfigurable implements SearchableConfigurable { - @Nullable private JCheckBox myCbShowImportPopup; - @Nullable private JCheckBox myCbAddUnambiguousImports; - @Nullable private JBList myExcludePackagesList; - @Nullable private DefaultListModel myExcludePackagesModel; + private JCheckBox myCbShowImportPopup; + private JCheckBox myCbAddUnambiguousImports; + private JBList myExcludePackagesList; + private DefaultListModel myExcludePackagesModel; @NotNull private GoCodeInsightSettings myCodeInsightSettings; @NotNull private GoExcludedPathsSettings myExcludedSettings; @@ -82,7 +82,6 @@ public void focusList() { myExcludePackagesList.requestFocus(); } - @NotNull private String[] getExcludedPackages() { String[] excludedPackages = new String[myExcludePackagesModel.size()]; for (int i = 0; i < myExcludePackagesModel.size(); i++) { @@ -130,7 +129,6 @@ public Runnable enableSearch(String option) { return null; } - @NotNull @Nls @Override public String getDisplayName() { diff --git a/src/com/goide/codeInsight/imports/GoCodeInsightSettings.java b/src/com/goide/codeInsight/imports/GoCodeInsightSettings.java index 96014148f6..6faf71f76a 100644 --- a/src/com/goide/codeInsight/imports/GoCodeInsightSettings.java +++ b/src/com/goide/codeInsight/imports/GoCodeInsightSettings.java @@ -19,7 +19,6 @@ import com.goide.GoConstants; import com.intellij.openapi.components.*; import com.intellij.util.xmlb.XmlSerializerUtil; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @State( @@ -41,7 +40,7 @@ public GoCodeInsightSettings getState() { } @Override - public void loadState(@NotNull GoCodeInsightSettings state) { + public void loadState(GoCodeInsightSettings state) { XmlSerializerUtil.copyBean(state, this); } diff --git a/src/com/goide/codeInsight/imports/GoExcludePathLookupActionProvider.java b/src/com/goide/codeInsight/imports/GoExcludePathLookupActionProvider.java index c411b4790d..edea859e4f 100644 --- a/src/com/goide/codeInsight/imports/GoExcludePathLookupActionProvider.java +++ b/src/com/goide/codeInsight/imports/GoExcludePathLookupActionProvider.java @@ -36,7 +36,7 @@ public class GoExcludePathLookupActionProvider implements LookupActionProvider { @Override - public void fillActions(@NotNull LookupElement element, Lookup lookup, @NotNull Consumer consumer) { + public void fillActions(LookupElement element, Lookup lookup, Consumer consumer) { PsiElement psiElement = element.getPsiElement(); PsiFile file = psiElement != null ? psiElement.getContainingFile() : null; String importPath = file instanceof GoFile ? ((GoFile)file).getImportPath() : null; @@ -49,8 +49,7 @@ public void fillActions(@NotNull LookupElement element, Lookup lookup, @NotNull } } - @NotNull - private static List getPaths(@NotNull String importPath) { + private static List getPaths(String importPath) { List result = ContainerUtil.newArrayList(importPath); int i; while ((i = importPath.lastIndexOf('/')) > 0) { diff --git a/src/com/goide/codeInsight/imports/GoImportOptimizer.java b/src/com/goide/codeInsight/imports/GoImportOptimizer.java index c081258ee9..13c7801a35 100644 --- a/src/com/goide/codeInsight/imports/GoImportOptimizer.java +++ b/src/com/goide/codeInsight/imports/GoImportOptimizer.java @@ -112,8 +112,7 @@ public static Set findRedundantImportIdentifiers(@NotNull MultiMap filterUnusedImports(@NotNull PsiFile file, + public static MultiMap filterUnusedImports(@NotNull PsiFile file, @NotNull MultiMap importMap) { final MultiMap result = MultiMap.create(); result.putAllValues(importMap); diff --git a/src/com/goide/configuration/GoBuildTargetConfigurable.java b/src/com/goide/configuration/GoBuildTargetConfigurable.java index 92ccc0f5bb..ce0e80f221 100644 --- a/src/com/goide/configuration/GoBuildTargetConfigurable.java +++ b/src/com/goide/configuration/GoBuildTargetConfigurable.java @@ -192,7 +192,6 @@ public void disposeUIResources() { UIUtil.dispose(myCustomFlagsField); } - @NotNull @Nls @Override public String getDisplayName() { diff --git a/src/com/goide/configuration/GoConfigurableProvider.java b/src/com/goide/configuration/GoConfigurableProvider.java index c1f96c0080..2ee79a4913 100644 --- a/src/com/goide/configuration/GoConfigurableProvider.java +++ b/src/com/goide/configuration/GoConfigurableProvider.java @@ -50,13 +50,12 @@ public Configurable createConfigurable() { } private static class GoCompositeConfigurable extends SearchableConfigurable.Parent.Abstract { - @Nullable private Configurable[] myConfigurables; + private Configurable[] myConfigurables; public GoCompositeConfigurable(Configurable... configurables) { myConfigurables = configurables; } - @Nullable @Override protected Configurable[] buildConfigurables() { return myConfigurables; diff --git a/src/com/goide/configuration/GoLibrariesConfigurable.java b/src/com/goide/configuration/GoLibrariesConfigurable.java index 38887aa7ce..619e155794 100644 --- a/src/com/goide/configuration/GoLibrariesConfigurable.java +++ b/src/com/goide/configuration/GoLibrariesConfigurable.java @@ -49,7 +49,7 @@ public class GoLibrariesConfigurable implements SearchableConfigurable, Configurable.NoScroll { @NotNull private final String myDisplayName; - @NotNull private final GoLibrariesService myLibrariesService; + private final GoLibrariesService myLibrariesService; private final String[] myReadOnlyPaths; private final JBCheckBox myUseEnvGoPathCheckBox = new JBCheckBox("Use GOPATH that's defined in system environment"); private final JPanel myPanel = new JPanel(new BorderLayout()); @@ -151,7 +151,7 @@ public void actionPerformed(@NotNull ActionEvent event) { } } - private static void scrollToSelection(@NotNull JList list) { + private static void scrollToSelection(JList list) { int selectedRow = list.getSelectedIndex(); if (selectedRow >= 0) { list.scrollRectToVisible(list.getCellBounds(selectedRow, 0)); diff --git a/src/com/goide/configuration/GoLibrariesConfigurableProvider.java b/src/com/goide/configuration/GoLibrariesConfigurableProvider.java index e87fd1a3fd..80ca9a344b 100644 --- a/src/com/goide/configuration/GoLibrariesConfigurableProvider.java +++ b/src/com/goide/configuration/GoLibrariesConfigurableProvider.java @@ -111,9 +111,8 @@ protected List createConfigurables() { String[] urlsFromEnv = ContainerUtil.map2Array(ContainerUtil.mapNotNull(GoSdkUtil.getGoPathsRootsFromEnvironment(), new GoSdkUtil.RetrieveSubDirectoryOrSelfFunction("src")), String.class, new Function() { - @NotNull @Override - public String fun(@NotNull VirtualFile file) { + public String fun(VirtualFile file) { return file.getUrl(); } }); @@ -172,11 +171,11 @@ private String configurableExpandedPropertyKey(@NotNull Configurable configurabl } class MyHideableDecoratorListener extends ListenableHideableDecorator.MyListener { - @NotNull private final GridLayoutManager myLayoutManager; - @NotNull private final JPanel myHideablePanel; + private final GridLayoutManager myLayoutManager; + private final JPanel myHideablePanel; @NotNull private final String myStoreKey; - @NotNull private final Spacer mySpacer; - @NotNull private final Collection myHideableDecorators; + private final Spacer mySpacer; + private final Collection myHideableDecorators; public MyHideableDecoratorListener(@NotNull GridLayoutManager layoutManager, @NotNull JPanel hideablePanel, diff --git a/src/com/goide/configuration/GoModuleEditorsProvider.java b/src/com/goide/configuration/GoModuleEditorsProvider.java index 014dfc9198..8648ba1a81 100644 --- a/src/com/goide/configuration/GoModuleEditorsProvider.java +++ b/src/com/goide/configuration/GoModuleEditorsProvider.java @@ -45,7 +45,7 @@ public ModuleConfigurationEditor[] createEditors(@NotNull ModuleConfigurationSta } static class OutputEditorEx extends OutputEditor { - protected OutputEditorEx(@NotNull ModuleConfigurationState state) { + protected OutputEditorEx(ModuleConfigurationState state) { super(state); } diff --git a/src/com/goide/configuration/GoSdkConfigurable.java b/src/com/goide/configuration/GoSdkConfigurable.java index afe07ae037..ec823ce9fa 100644 --- a/src/com/goide/configuration/GoSdkConfigurable.java +++ b/src/com/goide/configuration/GoSdkConfigurable.java @@ -67,9 +67,9 @@ public class GoSdkConfigurable implements SearchableConfigurable, Configurable.N @NotNull private final Alarm myAlarm = new Alarm(Alarm.ThreadToUse.POOLED_THREAD, myDisposable); private JPanel myComponent; private TextFieldWithBrowseButton mySdkPathField; - @Nullable private JPanel myVersionPanel; - @Nullable private JBLabel myVersionLabel; - @Nullable private Color myDefaultLabelColor; + private JPanel myVersionPanel; + private JBLabel myVersionLabel; + private Color myDefaultLabelColor; public GoSdkConfigurable(@NotNull Project project, boolean dialogMode) { myProject = project; @@ -150,7 +150,6 @@ public Runnable enableSearch(String option) { return null; } - @NotNull @Nls @Override public String getDisplayName() { diff --git a/src/com/goide/editor/GoParameterInfoHandler.java b/src/com/goide/editor/GoParameterInfoHandler.java index 6476bfcc77..b003e8a55f 100644 --- a/src/com/goide/editor/GoParameterInfoHandler.java +++ b/src/com/goide/editor/GoParameterInfoHandler.java @@ -143,7 +143,6 @@ public void updateUI(@Nullable Object p, @NotNull ParameterInfoUIContext context updatePresentation(p, context); } - @Nullable String updatePresentation(@Nullable Object p, @NotNull ParameterInfoUIContext context) { if (p == null) { context.setUIComponentEnabled(false); diff --git a/src/com/goide/editor/GoWordSelectioner.java b/src/com/goide/editor/GoWordSelectioner.java index c70a47cb7c..dc8bc97075 100644 --- a/src/com/goide/editor/GoWordSelectioner.java +++ b/src/com/goide/editor/GoWordSelectioner.java @@ -34,7 +34,7 @@ public boolean canSelect(@NotNull PsiElement e) { } @Override - public List select(@NotNull PsiElement e, @NotNull CharSequence editorText, int cursorOffset, @NotNull Editor editor) { + public List select(@NotNull PsiElement e, CharSequence editorText, int cursorOffset, Editor editor) { PsiElement parent = e.getParent(); List result = super.select(e, editorText, cursorOffset, editor); if (parent instanceof GoImportString || parent instanceof GoStringLiteral) { diff --git a/src/com/goide/editor/surround/GoSurroundDescriptor.java b/src/com/goide/editor/surround/GoSurroundDescriptor.java index f5d6e72053..2762efd37e 100644 --- a/src/com/goide/editor/surround/GoSurroundDescriptor.java +++ b/src/com/goide/editor/surround/GoSurroundDescriptor.java @@ -46,7 +46,7 @@ public Surrounder[] getSurrounders() { @NotNull @Override - public PsiElement[] getElementsToSurround(@NotNull PsiFile file, int startOffset, int endOffset) { + public PsiElement[] getElementsToSurround(PsiFile file, int startOffset, int endOffset) { GoExpression expr = GoIntroduceVariableBase.findExpressionInSelection(file, startOffset, endOffset); if (expr == null) return PsiElement.EMPTY_ARRAY; UsageTrigger.trigger("go.surroundwith.expression"); @@ -60,7 +60,6 @@ public boolean isExclusive() { } public static class GoParenthesisSurrounder implements Surrounder { - @NotNull @Override public String getTemplateDescription() { return "(expression)"; diff --git a/src/com/goide/formatter/settings/GoCodeStyleConfigurable.java b/src/com/goide/formatter/settings/GoCodeStyleConfigurable.java index 66deedf06d..61fc30729f 100644 --- a/src/com/goide/formatter/settings/GoCodeStyleConfigurable.java +++ b/src/com/goide/formatter/settings/GoCodeStyleConfigurable.java @@ -31,7 +31,7 @@ public GoCodeStyleConfigurable(@NotNull CodeStyleSettings settings, CodeStyleSet @NotNull @Override - protected CodeStyleAbstractPanel createPanel(@NotNull CodeStyleSettings settings) { + protected CodeStyleAbstractPanel createPanel(CodeStyleSettings settings) { return new GoCodeStyleMainPanel(getCurrentSettings(), settings); } @@ -41,7 +41,7 @@ public String getHelpTopic() { } private static class GoCodeStyleMainPanel extends TabbedLanguageCodeStylePanel { - private GoCodeStyleMainPanel(CodeStyleSettings currentSettings, @NotNull CodeStyleSettings settings) { + private GoCodeStyleMainPanel(CodeStyleSettings currentSettings, CodeStyleSettings settings) { super(GoLanguage.INSTANCE, currentSettings, settings); } diff --git a/src/com/goide/go/GoGotoContributorBase.java b/src/com/goide/go/GoGotoContributorBase.java index bbbb655c97..d225356905 100644 --- a/src/com/goide/go/GoGotoContributorBase.java +++ b/src/com/goide/go/GoGotoContributorBase.java @@ -32,7 +32,7 @@ import org.jetbrains.annotations.Nullable; public class GoGotoContributorBase implements GotoClassContributor, ChooseByNameContributorEx { - @NotNull protected final StubIndexKey[] myIndexKeys; + protected final StubIndexKey[] myIndexKeys; @NotNull private final Class myClazz; public GoGotoContributorBase(@NotNull Class clazz, @NotNull StubIndexKey... key) { diff --git a/src/com/goide/inspections/GoDeleteQuickFix.java b/src/com/goide/inspections/GoDeleteQuickFix.java index 01cb3ba82b..acafb3a0c8 100644 --- a/src/com/goide/inspections/GoDeleteQuickFix.java +++ b/src/com/goide/inspections/GoDeleteQuickFix.java @@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull; public class GoDeleteQuickFix extends LocalQuickFixBase { - public GoDeleteQuickFix(@NotNull String name) { + public GoDeleteQuickFix(String name) { super(name); } diff --git a/src/com/goide/inspections/GoDuplicateArgumentInspection.java b/src/com/goide/inspections/GoDuplicateArgumentInspection.java index 15b4e69a90..85791a3c51 100644 --- a/src/com/goide/inspections/GoDuplicateArgumentInspection.java +++ b/src/com/goide/inspections/GoDuplicateArgumentInspection.java @@ -62,7 +62,6 @@ protected static void checkParameters(@NotNull ProblemsHolder holder, } } - @NotNull private static String errorText(@NotNull String name) { return "Duplicate argument " + "'" + name + "'"; } diff --git a/src/com/goide/inspections/GoDuplicateFunctionInspection.java b/src/com/goide/inspections/GoDuplicateFunctionInspection.java index 12ab51e60b..ed36a532db 100644 --- a/src/com/goide/inspections/GoDuplicateFunctionInspection.java +++ b/src/com/goide/inspections/GoDuplicateFunctionInspection.java @@ -60,7 +60,7 @@ public void visitFunctionDeclaration(@NotNull final GoFunctionDeclaration o) { if ((MAIN.equals(name) && MAIN.equals(o.getContainingFile().getPackageName()) && zeroArity(o))) { byKey = ContainerUtil.filter(byKey, new Condition() { @Override - public boolean value(@NotNull GoFunctionDeclaration declaration) { + public boolean value(GoFunctionDeclaration declaration) { return Comparing.equal(declaration.getContainingFile(), o.getContainingFile()); } }); diff --git a/src/com/goide/inspections/GoDuplicateMethodInspection.java b/src/com/goide/inspections/GoDuplicateMethodInspection.java index 5540c4e4bf..3949c209fb 100644 --- a/src/com/goide/inspections/GoDuplicateMethodInspection.java +++ b/src/com/goide/inspections/GoDuplicateMethodInspection.java @@ -52,7 +52,7 @@ protected void checkFile(@NotNull GoFile file, @NotNull ProblemsHolder problemsH Collection declarations = GoMethodIndex.find(packageName + "." + typeText, project, scope); declarations = ContainerUtil.filter(declarations, new Condition() { @Override - public boolean value(@NotNull GoMethodDeclaration d) { + public boolean value(GoMethodDeclaration d) { return !method.isEquivalentTo(d) && Comparing.equal(d.getName(), methodName) && GoUtil.allowed(d.getContainingFile()); } }); diff --git a/src/com/goide/inspections/GoMultiplePackagesQuickFix.java b/src/com/goide/inspections/GoMultiplePackagesQuickFix.java index ca00d53dcf..07be72a7fe 100644 --- a/src/com/goide/inspections/GoMultiplePackagesQuickFix.java +++ b/src/com/goide/inspections/GoMultiplePackagesQuickFix.java @@ -48,7 +48,7 @@ public class GoMultiplePackagesQuickFix extends LocalQuickFixAndIntentionActionO private Collection myPackages; private String myPackageName; private boolean myIsOneTheFly; - @Nullable private static String myTestingPackageName; + private static String myTestingPackageName; protected GoMultiplePackagesQuickFix(@NotNull PsiElement element, @NotNull String packageName, Collection packages, boolean isOnTheFly) { super(element); diff --git a/src/com/goide/inspections/GoRenameQuickFix.java b/src/com/goide/inspections/GoRenameQuickFix.java index 4592bddb66..4001b1f1be 100644 --- a/src/com/goide/inspections/GoRenameQuickFix.java +++ b/src/com/goide/inspections/GoRenameQuickFix.java @@ -37,7 +37,7 @@ import org.jetbrains.annotations.NotNull; public class GoRenameQuickFix extends LocalQuickFixOnPsiElement { - @NotNull private final String myText; + private final String myText; protected GoRenameQuickFix(@NotNull GoNamedElement element) { super(element); diff --git a/src/com/goide/inspections/GoRenameToBlankQuickFix.java b/src/com/goide/inspections/GoRenameToBlankQuickFix.java index d43f21cec3..be09591b79 100644 --- a/src/com/goide/inspections/GoRenameToBlankQuickFix.java +++ b/src/com/goide/inspections/GoRenameToBlankQuickFix.java @@ -27,7 +27,7 @@ public class GoRenameToBlankQuickFix extends LocalQuickFixOnPsiElement { public static final String NAME = "Rename to _"; - public GoRenameToBlankQuickFix(@NotNull GoNamedElement o) { + public GoRenameToBlankQuickFix(GoNamedElement o) { super(o); } diff --git a/src/com/goide/inspections/GoTestSignaturesInspection.java b/src/com/goide/inspections/GoTestSignaturesInspection.java index 00e8cfa4f6..61009bf40c 100644 --- a/src/com/goide/inspections/GoTestSignaturesInspection.java +++ b/src/com/goide/inspections/GoTestSignaturesInspection.java @@ -43,8 +43,7 @@ private static String getTestingAlias(@Nullable GoImportSpec testingImportSpec) return GoConstants.TESTING_PATH; } - @NotNull - private static String getProperParamType(@NotNull String testingAlias, @NotNull GoTestFunctionType type) { + private static String getProperParamType(@NotNull String testingAlias, GoTestFunctionType type) { return "*" + (testingAlias.isEmpty() ? "" : testingAlias + ".") + type.getParamType(); } diff --git a/src/com/goide/inspections/MismatchedBuildTargetNotificationProvider.java b/src/com/goide/inspections/MismatchedBuildTargetNotificationProvider.java index d6562493d4..0a46ee569f 100644 --- a/src/com/goide/inspections/MismatchedBuildTargetNotificationProvider.java +++ b/src/com/goide/inspections/MismatchedBuildTargetNotificationProvider.java @@ -44,7 +44,7 @@ public class MismatchedBuildTargetNotificationProvider extends EditorNotifications.Provider implements DumbAware { private static final Key KEY = Key.create("Mismatched build target"); - @NotNull private final Project myProject; + private final Project myProject; public MismatchedBuildTargetNotificationProvider(@NotNull Project project, @NotNull final EditorNotifications notifications, diff --git a/src/com/goide/inspections/WrongModuleTypeNotificationProvider.java b/src/com/goide/inspections/WrongModuleTypeNotificationProvider.java index 0e3d272c13..80eea0e0ca 100644 --- a/src/com/goide/inspections/WrongModuleTypeNotificationProvider.java +++ b/src/com/goide/inspections/WrongModuleTypeNotificationProvider.java @@ -41,7 +41,7 @@ public class WrongModuleTypeNotificationProvider extends EditorNotifications.Pro private static final Key KEY = Key.create("Wrong module type"); private static final String DONT_ASK_TO_CHANGE_MODULE_TYPE_KEY = "do.not.ask.to.change.module.type"; - @NotNull private final Project myProject; + private final Project myProject; public WrongModuleTypeNotificationProvider(@NotNull Project project) { myProject = project; diff --git a/src/com/goide/inspections/WrongSdkConfigurationNotificationProvider.java b/src/com/goide/inspections/WrongSdkConfigurationNotificationProvider.java index bb26c98cbe..0b417de2d1 100644 --- a/src/com/goide/inspections/WrongSdkConfigurationNotificationProvider.java +++ b/src/com/goide/inspections/WrongSdkConfigurationNotificationProvider.java @@ -47,7 +47,7 @@ public class WrongSdkConfigurationNotificationProvider extends EditorNotifications.Provider implements DumbAware { private static final Key KEY = Key.create("Setup Go SDK"); - @NotNull private final Project myProject; + private final Project myProject; public WrongSdkConfigurationNotificationProvider(@NotNull Project project, @NotNull final EditorNotifications notifications) { myProject = project; diff --git a/src/com/goide/inspections/suppression/GoInspectionSuppressor.java b/src/com/goide/inspections/suppression/GoInspectionSuppressor.java index 5f5350cc94..0a8075c586 100644 --- a/src/com/goide/inspections/suppression/GoInspectionSuppressor.java +++ b/src/com/goide/inspections/suppression/GoInspectionSuppressor.java @@ -68,7 +68,7 @@ public SuppressQuickFix[] getSuppressActions(PsiElement element, @NotNull String public static class GoSuppressInspectionFix extends AbstractBatchSuppressByNoInspectionCommentFix { private final Class myContainerClass; - @NotNull private final String myBaseText; + private final String myBaseText; private final boolean myTopMost; public GoSuppressInspectionFix(@NotNull String elementDescription, diff --git a/src/com/goide/parser/GoParserUtil.java b/src/com/goide/parser/GoParserUtil.java index 5869774736..f1edbbe1c7 100644 --- a/src/com/goide/parser/GoParserUtil.java +++ b/src/com/goide/parser/GoParserUtil.java @@ -47,7 +47,7 @@ private static TObjectIntHashMap getParsingModes(@NotNull PsiBuilder bui return flags; } - public static boolean consumeBlock(@NotNull PsiBuilder builder_, @SuppressWarnings("UnusedParameters") int level) { + public static boolean consumeBlock(PsiBuilder builder_, @SuppressWarnings("UnusedParameters") int level) { PsiFile file = builder_.getUserDataUnprotected(FileContextUtil.CONTAINING_FILE_KEY); if (file == null) return false; VirtualFile data = file.getUserData(IndexingDataKeys.VIRTUAL_FILE); @@ -82,11 +82,11 @@ public static boolean isModeOn(@NotNull PsiBuilder builder_, @SuppressWarnings(" return getParsingModes(builder_).get(mode) > 0; } - public static boolean withOn(@NotNull PsiBuilder builder_, int level_, String mode, Parser parser) { + public static boolean withOn(PsiBuilder builder_, int level_, String mode, Parser parser) { return withImpl(builder_, level_, mode, true, parser, parser); } - public static boolean withOff(@NotNull PsiBuilder builder_, int level_, @NotNull Parser parser, @NotNull String... modes) { + public static boolean withOff(PsiBuilder builder_, int level_, Parser parser, String... modes) { final TObjectIntHashMap map = getParsingModes(builder_); TObjectIntHashMap prev = new TObjectIntHashMap(); @@ -112,7 +112,7 @@ public boolean execute(String mode, int p) { return result; } - private static boolean withImpl(@NotNull PsiBuilder builder_, int level_, String mode, boolean onOff, Parser whenOn, Parser whenOff) { + private static boolean withImpl(PsiBuilder builder_, int level_, String mode, boolean onOff, Parser whenOn, Parser whenOff) { TObjectIntHashMap map = getParsingModes(builder_); int prev = map.get(mode); boolean change = ((prev & 1) == 0) == onOff; diff --git a/src/com/goide/project/GoBuildTargetSettings.java b/src/com/goide/project/GoBuildTargetSettings.java index 3e40368f1f..b3a418faf0 100644 --- a/src/com/goide/project/GoBuildTargetSettings.java +++ b/src/com/goide/project/GoBuildTargetSettings.java @@ -116,7 +116,6 @@ public void setGoVersion(@NotNull String goVersion) { notifyChange(); } - @NotNull public GoTargetSystem getTargetSystemDescriptor(@Nullable Module module) { String os = realValue(myState.os, GoUtil.systemOS()); String arch = realValue(myState.arch, GoUtil.systemArch()); @@ -129,7 +128,6 @@ public GoTargetSystem getTargetSystemDescriptor(@Nullable Module module) { return new GoTargetSystem(os, arch, realValue(myState.goVersion, moduleSdkVersion), compiler, cgo, customFlags); } - @Nullable @Contract("_,null->!null") private static String realValue(@NotNull String value, @Nullable String defaultValue) { return DEFAULT.equals(value) ? defaultValue : value; @@ -142,7 +140,7 @@ public GoBuildTargetSettingsState getState() { } @Override - public void loadState(@NotNull GoBuildTargetSettingsState state) { + public void loadState(GoBuildTargetSettingsState state) { XmlSerializerUtil.copyBean(state, myState); } diff --git a/src/com/goide/project/GoExcludedPathsSettings.java b/src/com/goide/project/GoExcludedPathsSettings.java index c0da494060..cd3d0c841e 100644 --- a/src/com/goide/project/GoExcludedPathsSettings.java +++ b/src/com/goide/project/GoExcludedPathsSettings.java @@ -35,7 +35,7 @@ public class GoExcludedPathsSettings extends SimpleModificationTracker implements PersistentStateComponent { private String[] myExcludedPackages = ArrayUtil.EMPTY_STRING_ARRAY; - public static GoExcludedPathsSettings getInstance(@NotNull Project project) { + public static GoExcludedPathsSettings getInstance(Project project) { return ServiceManager.getService(project, GoExcludedPathsSettings.class); } @@ -46,7 +46,7 @@ public GoExcludedPathsSettings getState() { } @Override - public void loadState(@NotNull GoExcludedPathsSettings state) { + public void loadState(GoExcludedPathsSettings state) { XmlSerializerUtil.copyBean(state, this); } diff --git a/src/com/goide/project/GoLibrariesService.java b/src/com/goide/project/GoLibrariesService.java index 9a1989b21b..a2bb7a5c56 100644 --- a/src/com/goide/project/GoLibrariesService.java +++ b/src/com/goide/project/GoLibrariesService.java @@ -48,7 +48,7 @@ public T getState() { } @Override - public void loadState(@NotNull T state) { + public void loadState(T state) { XmlSerializerUtil.copyBean(state, myState); } @@ -106,9 +106,8 @@ public Collection getLibraryRootUrls() { @NotNull private static Collection goRootsFromUrls(@NotNull Collection urls) { return ContainerUtil.skipNulls(ContainerUtil.map(urls, new Function() { - @Nullable @Override - public VirtualFile fun(@NotNull String url) { + public VirtualFile fun(String url) { VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(url); return file != null && GoSdkUtil.retrieveGoVersion(file.getPath()) == null ? file : null; } diff --git a/src/com/goide/project/GoModuleLibrariesInitializer.java b/src/com/goide/project/GoModuleLibrariesInitializer.java index 17d7056b82..a2e7db8e52 100644 --- a/src/com/goide/project/GoModuleLibrariesInitializer.java +++ b/src/com/goide/project/GoModuleLibrariesInitializer.java @@ -64,8 +64,8 @@ public class GoModuleLibrariesInitializer implements ModuleComponent { private static boolean isTestingMode = false; private final Set myFilesToWatch = ContainerUtil.newConcurrentSet(); - @NotNull private final Alarm myAlarm; - @NotNull private final MessageBusConnection myConnection; + private final Alarm myAlarm; + private final MessageBusConnection myConnection; private boolean myModuleInitialized = false; @NotNull private final Set myLastHandledRoots = ContainerUtil.newHashSet(); @@ -88,7 +88,7 @@ public void fileMoved(@NotNull VirtualFileMoveEvent event) { handleEvent(event); } - private void handleEvent(@NotNull VirtualFileEvent event) { + private void handleEvent(VirtualFileEvent event) { if (myFilesToWatch.contains(event.getFile())) { scheduleUpdate(); } @@ -160,7 +160,7 @@ private void scheduleUpdate(int delay) { } } - private void attachLibraries(@NotNull final Collection libraryRoots, @NotNull final Set exclusions) { + private void attachLibraries(@NotNull final Collection libraryRoots, final Set exclusions) { ApplicationManager.getApplication().assertIsDispatchThread(); if (!libraryRoots.isEmpty()) { @@ -191,12 +191,11 @@ public void run() { } } - @NotNull public String getLibraryName() { return GO_LIB_NAME + " <" + myModule.getName() + ">"; } - private static void fillLibrary(@NotNull Library library, @NotNull Collection libraryRoots, @NotNull Set exclusions) { + private static void fillLibrary(@NotNull Library library, @NotNull Collection libraryRoots, Set exclusions) { ApplicationManager.getApplication().assertWriteAccessAllowed(); Library.ModifiableModel libraryModel = library.getModifiableModel(); diff --git a/src/com/goide/project/GoModuleLibrariesService.java b/src/com/goide/project/GoModuleLibrariesService.java index 5bda703408..f359e92b91 100644 --- a/src/com/goide/project/GoModuleLibrariesService.java +++ b/src/com/goide/project/GoModuleLibrariesService.java @@ -24,14 +24,12 @@ import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleServiceManager; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; @State( name = GoConstants.GO_LIBRARIES_SERVICE_NAME, storages = @Storage(file = StoragePathMacros.MODULE_FILE) ) public class GoModuleLibrariesService extends GoLibrariesService { - @Nullable public static GoModuleLibrariesService getInstance(@NotNull Module module) { return ModuleServiceManager.getService(module, GoModuleLibrariesService.class); } diff --git a/src/com/goide/psi/GoFile.java b/src/com/goide/psi/GoFile.java index 8d385e3b6e..08281882b7 100644 --- a/src/com/goide/psi/GoFile.java +++ b/src/com/goide/psi/GoFile.java @@ -180,7 +180,6 @@ public Result> compute() { }); } - @Nullable public GoImportSpec addImport(String path, String alias) { GoImportList importList = getImportList(); if (importList != null) { @@ -501,7 +500,7 @@ else if (child instanceof PsiWhiteSpace) { final int finalLastEmptyLineOffset = lastEmptyLineOffset; return ContainerUtil.filter(commentsToConsider, new Condition() { @Override - public boolean value(@NotNull PsiComment comment) { + public boolean value(PsiComment comment) { return comment.getTextRange().getStartOffset() < finalLastEmptyLineOffset; } }); diff --git a/src/com/goide/psi/impl/GoCachedReference.java b/src/com/goide/psi/impl/GoCachedReference.java index 74d20a6cca..01ffdb4e49 100644 --- a/src/com/goide/psi/impl/GoCachedReference.java +++ b/src/com/goide/psi/impl/GoCachedReference.java @@ -31,9 +31,8 @@ protected GoCachedReference(@NotNull T element) { super(element, TextRange.from(0, element.getTextLength())); } - @Nullable private static final ResolveCache.AbstractResolver MY_RESOLVER = + private static final ResolveCache.AbstractResolver MY_RESOLVER = new ResolveCache.AbstractResolver() { - @Nullable @Override public PsiElement resolve(@NotNull PsiReferenceBase base, boolean b) { return ((GoCachedReference)base).resolveInner(); @@ -60,7 +59,7 @@ public PsiElement handleElementRename(String newElementName) throws IncorrectOpe } @Override - public boolean isReferenceTo(@NotNull PsiElement element) { + public boolean isReferenceTo(PsiElement element) { return GoUtil.couldBeReferenceTo(element, myElement) && super.isReferenceTo(element); } diff --git a/src/com/goide/psi/impl/GoElementFactory.java b/src/com/goide/psi/impl/GoElementFactory.java index 22f8872c2f..bc382fb1ef 100644 --- a/src/com/goide/psi/impl/GoElementFactory.java +++ b/src/com/goide/psi/impl/GoElementFactory.java @@ -110,7 +110,6 @@ public static GoStatement createShortVarDeclarationStatement(@NotNull Project pr return PsiTreeUtil.findChildOfType(file, GoSimpleStatement.class); } - @Nullable public static GoAssignmentStatement createAssignmentStatement(@NotNull Project project, @NotNull String left, @NotNull String right) { GoFile file = createFileFromText(project, "package a; func a() {\n " + left + " = " + right + "}"); return PsiTreeUtil.findChildOfType(file, GoAssignmentStatement.class); diff --git a/src/com/goide/psi/impl/GoPsiImplUtil.java b/src/com/goide/psi/impl/GoPsiImplUtil.java index 436cf72e21..da2a9238f4 100644 --- a/src/com/goide/psi/impl/GoPsiImplUtil.java +++ b/src/com/goide/psi/impl/GoPsiImplUtil.java @@ -86,7 +86,7 @@ public static GlobalSearchScope packageScope(@NotNull GoFile file) { List files = getAllPackageFiles(file); return GlobalSearchScope.filesScope(file.getProject(), ContainerUtil.map(files, new Function() { @Override - public VirtualFile fun(@NotNull GoFile file) { + public VirtualFile fun(GoFile file) { return file.getVirtualFile(); } })); @@ -169,7 +169,7 @@ public PsiElement resolve() { return refs.length > 1 ? refs[1].resolve() : null; } - public boolean isReferenceTo(@NotNull PsiElement element) { + public boolean isReferenceTo(PsiElement element) { return GoUtil.couldBeReferenceTo(element, getElement()) && getElement().getManager().areElementsEquivalent(resolve(), element); } }; @@ -301,7 +301,6 @@ private static GoType findTypeInConstSpec(@NotNull GoConstDefinition o) { @Nullable public static GoType getGoType(@NotNull final GoExpression o, @Nullable final ResolveState context) { return RecursionManager.doPreventingRecursion(o, true, new Computable() { - @Nullable @Override public GoType compute() { if (context != null) return getGoTypeInner(o, context); @@ -433,7 +432,7 @@ private static GoType getBuiltinType(@NotNull GoExpression o, @NotNull final Str if (builtin != null) { GoTypeSpec spec = ContainerUtil.find(builtin.getTypes(), new Condition() { @Override - public boolean value(@NotNull GoTypeSpec spec) { + public boolean value(GoTypeSpec spec) { return name.equals(spec.getName()); } }); @@ -463,7 +462,6 @@ protected MyArrayType(GoType type) { myType = type; } - @Nullable @Override public String getText() { return myType != null ? ("[]" + myType.getText()) : null; @@ -506,19 +504,16 @@ public PsiElement getTripleDot() { return null; } - @Nullable @Override public String toString() { return null; } - @Nullable @Override public IStubElementType getElementType() { return null; } - @Nullable @Override public GoTypeStub getStub() { return null; @@ -789,19 +784,16 @@ public GoTypeReferenceExpression getTypeReferenceExpression() { return null; } - @NotNull @Override public String toString() { return "MyGoTypeList{myTypes=" + myTypes + '}'; } - @Nullable @Override public IStubElementType getElementType() { return null; } - @Nullable @Override public GoTypeStub getStub() { return null; @@ -891,7 +883,6 @@ public static GoImportSpec addImportSpec(@NotNull GoImportDeclaration declaratio return spec; } - @NotNull public static String getLocalPackageName(@NotNull String importPath) { StringBuilder name = null; for (int i = 0; i < importPath.length(); i++) { @@ -910,7 +901,6 @@ else if (name != null) { return name == null ? importPath : name.toString(); } - @NotNull public static String getLocalPackageName(@NotNull GoImportSpec importSpec) { return getLocalPackageName(importSpec.getPath()); } @@ -930,7 +920,6 @@ public static String getPath(@NotNull GoImportSpec importSpec) { return stub != null ? stub.getPath() : importSpec.getImportString().getPath(); } - @Nullable public static String getName(@NotNull GoImportSpec importSpec) { return getAlias(importSpec); } diff --git a/src/com/goide/psi/impl/GoStubbedElementImpl.java b/src/com/goide/psi/impl/GoStubbedElementImpl.java index 1347c9fa67..150c3c0584 100644 --- a/src/com/goide/psi/impl/GoStubbedElementImpl.java +++ b/src/com/goide/psi/impl/GoStubbedElementImpl.java @@ -68,7 +68,7 @@ public boolean processDeclarations(@NotNull PsiScopeProcessor processor, } @Nullable - protected C findChildByClass(Class c, @NotNull Class s) { + protected C findChildByClass(Class c, Class s) { T stub = getStub(); if (stub != null) { for (StubElement stubElement : stub.getChildrenStubs()) { @@ -83,12 +83,12 @@ protected C findChildByClass(Class c, @NotNull Class s) { } @Nullable - protected C findNotNullChildByClass(Class c, @NotNull Class s) { + protected C findNotNullChildByClass(Class c, Class s) { return notNullChild(findChildByClass(c, s)); } @NotNull - protected List findChildrenByClass(@NotNull Class c, @NotNull Class s) { + protected List findChildrenByClass(Class c, Class s) { T stub = getStub(); if (stub != null) { List result = new SmartList(); diff --git a/src/com/goide/psi/impl/GoTypeReference.java b/src/com/goide/psi/impl/GoTypeReference.java index 38de699775..a78dca75e4 100644 --- a/src/com/goide/psi/impl/GoTypeReference.java +++ b/src/com/goide/psi/impl/GoTypeReference.java @@ -69,7 +69,7 @@ private ResolveResult[] resolveInner() { } @Override - public boolean isReferenceTo(@NotNull PsiElement element) { + public boolean isReferenceTo(PsiElement element) { return GoUtil.couldBeReferenceTo(element, myElement) && super.isReferenceTo(element); } @@ -139,7 +139,7 @@ private boolean processUnqualifiedResolve(@NotNull GoFile file, if (builtinFile == null) return false; GoVarDefinition nil = ContainerUtil.find(builtinFile.getVars(), new Condition() { @Override - public boolean value(@NotNull GoVarDefinition v) { + public boolean value(GoVarDefinition v) { return GoConstants.NIL.equals(v.getName()); } }); diff --git a/src/com/goide/psi/impl/GoVarProcessor.java b/src/com/goide/psi/impl/GoVarProcessor.java index 0b360d40dc..99b4563569 100644 --- a/src/com/goide/psi/impl/GoVarProcessor.java +++ b/src/com/goide/psi/impl/GoVarProcessor.java @@ -25,7 +25,7 @@ public class GoVarProcessor extends GoScopeProcessorBase { private final boolean myImShortVarDeclaration; - @Nullable private final PsiElement myParentGuard; + private final PsiElement myParentGuard; @Nullable private final GoCompositeElement myScope; public GoVarProcessor(@NotNull PsiElement origin, boolean completion) { diff --git a/src/com/goide/psi/impl/GoVarReference.java b/src/com/goide/psi/impl/GoVarReference.java index 28b5e5c58b..85b7b488de 100644 --- a/src/com/goide/psi/impl/GoVarReference.java +++ b/src/com/goide/psi/impl/GoVarReference.java @@ -26,7 +26,7 @@ import org.jetbrains.annotations.Nullable; public class GoVarReference extends GoCachedReference { - @Nullable private final GoBlock myPotentialStopBlock; + private final GoBlock myPotentialStopBlock; public GoVarReference(@NotNull GoVarDefinition element) { super(element); @@ -75,7 +75,7 @@ public PsiElement handleElementRename(String newElementName) throws IncorrectOpe } @Override - public boolean isReferenceTo(@NotNull PsiElement element) { + public boolean isReferenceTo(PsiElement element) { return GoUtil.couldBeReferenceTo(element, myElement) && super.isReferenceTo(element); } } diff --git a/src/com/goide/psi/impl/imports/GoFileContextProvider.java b/src/com/goide/psi/impl/imports/GoFileContextProvider.java index 48341d8f0a..ad09269e0b 100644 --- a/src/com/goide/psi/impl/imports/GoFileContextProvider.java +++ b/src/com/goide/psi/impl/imports/GoFileContextProvider.java @@ -35,7 +35,7 @@ protected boolean isAvailable(@NotNull PsiFile file) { @NotNull @Override - public Collection getContextFolders(@NotNull PsiFile file) { + public Collection getContextFolders(PsiFile file) { VirtualFile virtualFile = file.getVirtualFile(); return virtualFile != null ? new GoImportReferenceHelper().getContexts(file.getProject(), virtualFile) diff --git a/src/com/goide/psi/impl/imports/GoImportReferenceHelper.java b/src/com/goide/psi/impl/imports/GoImportReferenceHelper.java index 2315cb7898..530203c9da 100644 --- a/src/com/goide/psi/impl/imports/GoImportReferenceHelper.java +++ b/src/com/goide/psi/impl/imports/GoImportReferenceHelper.java @@ -45,7 +45,7 @@ public class GoImportReferenceHelper extends FileReferenceHelper { @NotNull @Override - public List registerFixes(@NotNull FileReference reference) { + public List registerFixes(FileReference reference) { LocalQuickFix goGetFix = new GoGetPackageFix(reference.getFileReferenceSet().getPathString()); List result = ContainerUtil.newArrayList(goGetFix); int index = reference.getIndex(); @@ -78,7 +78,7 @@ public List registerFixes(@NotNull FileReference refere @NotNull @Override - public Collection getContexts(@NotNull final Project project, @NotNull VirtualFile file) { + public Collection getContexts(final Project project, @NotNull VirtualFile file) { PsiFileSystemItem psiFile = getPsiFileSystemItem(project, file); if (psiFile == null) { return Collections.emptyList(); @@ -87,7 +87,7 @@ public Collection getContexts(@NotNull final Project project, ContainerUtil.addAllNotNull(result, ContainerUtil.map(getPathsToLookup(psiFile), new Function() { @Nullable @Override - public PsiFileSystemItem fun(@NotNull VirtualFile file) { + public PsiFileSystemItem fun(VirtualFile file) { return getPsiFileSystemItem(project, file); } })); @@ -95,7 +95,7 @@ public PsiFileSystemItem fun(@NotNull VirtualFile file) { } @Override - public boolean isMine(@NotNull Project project, @NotNull VirtualFile file) { + public boolean isMine(Project project, @NotNull VirtualFile file) { PsiFileSystemItem psiFile = getPsiFileSystemItem(project, file); return psiFile != null && psiFile instanceof GoFile; } diff --git a/src/com/goide/psi/impl/manipulator/GoImportStringManipulator.java b/src/com/goide/psi/impl/manipulator/GoImportStringManipulator.java index 468b7bf1b2..4de4fa42f9 100644 --- a/src/com/goide/psi/impl/manipulator/GoImportStringManipulator.java +++ b/src/com/goide/psi/impl/manipulator/GoImportStringManipulator.java @@ -26,7 +26,7 @@ public class GoImportStringManipulator extends AbstractElementManipulator { @NotNull @Override - public GoImportString handleContentChange(@NotNull GoImportString string, @NotNull TextRange range, @NotNull String s) throws IncorrectOperationException { + public GoImportString handleContentChange(@NotNull GoImportString string, @NotNull TextRange range, String s) throws IncorrectOperationException { String newPackage = range.replace(string.getText(), s); return (GoImportString)string.replace(GoElementFactory.createImportString(string.getProject(), newPackage)); } diff --git a/src/com/goide/psi/impl/manipulator/GoStringManipulator.java b/src/com/goide/psi/impl/manipulator/GoStringManipulator.java index cc5dbea9ef..e938f25b49 100644 --- a/src/com/goide/psi/impl/manipulator/GoStringManipulator.java +++ b/src/com/goide/psi/impl/manipulator/GoStringManipulator.java @@ -23,9 +23,8 @@ import org.jetbrains.annotations.NotNull; public class GoStringManipulator extends AbstractElementManipulator { - @NotNull @Override - public GoStringLiteralImpl handleContentChange(@NotNull GoStringLiteralImpl literal, @NotNull TextRange range, @NotNull String newContent) + public GoStringLiteralImpl handleContentChange(@NotNull GoStringLiteralImpl literal, @NotNull TextRange range, String newContent) throws IncorrectOperationException { String newText = range.replace(literal.getText(), newContent); return literal.updateText(newText); diff --git a/src/com/goide/refactor/GoIntroduceOperation.java b/src/com/goide/refactor/GoIntroduceOperation.java index 68c117ee2d..22e3e7a4f5 100644 --- a/src/com/goide/refactor/GoIntroduceOperation.java +++ b/src/com/goide/refactor/GoIntroduceOperation.java @@ -29,9 +29,9 @@ import java.util.List; public class GoIntroduceOperation { - @NotNull final private Project myProject; - @NotNull final private Editor myEditor; - @NotNull final private PsiFile myFile; + final private Project myProject; + final private Editor myEditor; + final private PsiFile myFile; private GoExpression myExpression; private List myOccurrences; private LinkedHashSet mySuggestedNames; diff --git a/src/com/goide/refactor/GoIntroduceVariableBase.java b/src/com/goide/refactor/GoIntroduceVariableBase.java index f957695a44..cd60c726ca 100644 --- a/src/com/goide/refactor/GoIntroduceVariableBase.java +++ b/src/com/goide/refactor/GoIntroduceVariableBase.java @@ -47,7 +47,7 @@ import java.util.List; public class GoIntroduceVariableBase { - protected static void performAction(@NotNull final GoIntroduceOperation operation) { + protected static void performAction(final GoIntroduceOperation operation) { SelectionModel selectionModel = operation.getEditor().getSelectionModel(); boolean hasSelection = selectionModel.hasSelection(); GoExpression expression = @@ -79,13 +79,13 @@ protected static void performAction(@NotNull final GoIntroduceOperation operatio else { IntroduceTargetChooser.showChooser(operation.getEditor(), expressions, new Pass() { @Override - public void pass(@NotNull GoExpression expression) { + public void pass(GoExpression expression) { operation.setExpression(expression); performOnElement(operation); } }, new Function() { @Override - public String fun(@NotNull GoExpression expression) { + public String fun(GoExpression expression) { return expression.getText(); } }); @@ -98,7 +98,7 @@ public static GoExpression findExpressionInSelection(@NotNull PsiFile file, int } @Nullable - private static GoExpression findExpressionAtOffset(@NotNull GoIntroduceOperation operation) { + private static GoExpression findExpressionAtOffset(GoIntroduceOperation operation) { PsiFile file = operation.getFile(); int offset = operation.getEditor().getCaretModel().getOffset(); @@ -109,7 +109,7 @@ private static GoExpression findExpressionAtOffset(@NotNull GoIntroduceOperation } @NotNull - private static List collectNestedExpressions(@Nullable GoExpression expression) { + private static List collectNestedExpressions(GoExpression expression) { List expressions = ContainerUtil.newArrayList(); while (expression != null) { if (!(expression instanceof GoParenthesesExpr) && GoInspectionUtil.getExpressionResultCount(expression) == 1 && @@ -121,7 +121,7 @@ private static List collectNestedExpressions(@Nullable GoExpressio return expressions; } - protected static void performOnElement(@NotNull final GoIntroduceOperation operation) { + protected static void performOnElement(final GoIntroduceOperation operation) { GoExpression expression = operation.getExpression(); LinkedHashSet suggestedNames = getSuggestedNames(expression); operation.setSuggestedNames(suggestedNames); @@ -154,12 +154,12 @@ public void pass(OccurrencesChooser.ReplaceChoice choice) { } } - private static void performInplaceIntroduce(@NotNull GoIntroduceOperation operation) { + private static void performInplaceIntroduce(GoIntroduceOperation operation) { performReplace(operation); new GoInplaceVariableIntroducer(operation).performInplaceRefactoring(operation.getSuggestedNames()); } - protected static void performReplace(@NotNull final GoIntroduceOperation operation) { + protected static void performReplace(final GoIntroduceOperation operation) { final Project project = operation.getProject(); final PsiElement expression = operation.getExpression(); final List occurrences = operation.isReplaceAll() ? operation.getOccurrences() : Collections.singletonList(expression); @@ -190,8 +190,7 @@ public void run() { PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(operation.getEditor().getDocument()); } - @NotNull - private static LinkedHashSet getNamesInContext(@Nullable PsiElement context) { + private static LinkedHashSet getNamesInContext(PsiElement context) { if (context == null) return ContainerUtil.newLinkedHashSet(); LinkedHashSet names = ContainerUtil.newLinkedHashSet(); @@ -235,7 +234,7 @@ private static LinkedHashSet getSuggestedNames(GoExpression expression) return names; } - protected static void showCannotPerform(@NotNull GoIntroduceOperation operation, String message) { + protected static void showCannotPerform(GoIntroduceOperation operation, String message) { message = RefactoringBundle.getCannotRefactorMessage(message); CommonRefactoringUtil .showErrorHint(operation.getProject(), operation.getEditor(), message, RefactoringBundle.getCannotRefactorMessage(null), @@ -243,7 +242,7 @@ protected static void showCannotPerform(@NotNull GoIntroduceOperation operation, } private static class GoInplaceVariableIntroducer extends InplaceVariableIntroducer { - public GoInplaceVariableIntroducer(@NotNull GoIntroduceOperation operation) { + public GoInplaceVariableIntroducer(GoIntroduceOperation operation) { super(operation.getVar(), operation.getEditor(), operation.getProject(), "Introduce Variable", ArrayUtil.toObjectArray(operation.getOccurrences(), PsiElement.class), null); } diff --git a/src/com/goide/refactor/GoIntroduceVariableDialog.java b/src/com/goide/refactor/GoIntroduceVariableDialog.java index 2f17f79693..f0c1f6a79e 100644 --- a/src/com/goide/refactor/GoIntroduceVariableDialog.java +++ b/src/com/goide/refactor/GoIntroduceVariableDialog.java @@ -25,19 +25,18 @@ import com.intellij.ui.IdeBorderFactory; import com.intellij.util.ArrayUtil; import com.intellij.util.ui.UIUtil; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; class GoIntroduceVariableDialog extends RefactoringDialog { - @NotNull private final GoIntroduceOperation myOperation; + private final GoIntroduceOperation myOperation; private final int myOccurrencesCount; private NameSuggestionsField myNameField; private JCheckBox myReplaceAllCheckBox; - protected GoIntroduceVariableDialog(@NotNull GoIntroduceOperation operation) { + protected GoIntroduceVariableDialog(GoIntroduceOperation operation) { super(operation.getProject(), true); myOperation = operation; myOccurrencesCount = operation.getOccurrences().size(); @@ -80,7 +79,6 @@ protected JComponent createCenterPanel() { return panel; } - @NotNull private JComponent createNamePanel() { JPanel panel = new JPanel(new BorderLayout()); @@ -102,7 +100,6 @@ public void dataChanged() { return panel; } - @NotNull private JComponent createReplaceAllPanel() { JPanel panel = new JPanel(new FlowLayout()); diff --git a/src/com/goide/refactor/GoIntroduceVariableHandler.java b/src/com/goide/refactor/GoIntroduceVariableHandler.java index b9c3bca3d9..71b298b4c6 100644 --- a/src/com/goide/refactor/GoIntroduceVariableHandler.java +++ b/src/com/goide/refactor/GoIntroduceVariableHandler.java @@ -27,7 +27,7 @@ public class GoIntroduceVariableHandler extends GoIntroduceVariableBase implements RefactoringActionHandler { @Override - public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file, DataContext dataContext) { + public void invoke(@NotNull Project project, Editor editor, PsiFile file, DataContext dataContext) { if (!CommonRefactoringUtil.checkReadOnlyStatus(file)) return; performAction(new GoIntroduceOperation(project, editor, file)); } diff --git a/src/com/goide/refactor/GoRenameImportSpecProcessor.java b/src/com/goide/refactor/GoRenameImportSpecProcessor.java index a09c92ae32..213556e011 100644 --- a/src/com/goide/refactor/GoRenameImportSpecProcessor.java +++ b/src/com/goide/refactor/GoRenameImportSpecProcessor.java @@ -29,7 +29,7 @@ public class GoRenameImportSpecProcessor extends RenamePsiElementProcessor { @Nullable @Override - public PsiElement substituteElementToRename(@NotNull PsiElement element, @Nullable Editor editor) { + public PsiElement substituteElementToRename(PsiElement element, @Nullable Editor editor) { if (FindManager.getInstance(element.getProject()).canFindUsages(element)) { return element; } diff --git a/src/com/goide/runconfig/GoBuildingRunner.java b/src/com/goide/runconfig/GoBuildingRunner.java index 67045eccf4..8ec5d5f552 100644 --- a/src/com/goide/runconfig/GoBuildingRunner.java +++ b/src/com/goide/runconfig/GoBuildingRunner.java @@ -98,7 +98,7 @@ protected Promise prepare(@NotNull ExecutionEnvironment envir .withProcessListener(new ProcessAdapter() { @Override - public void processTerminated(@NotNull ProcessEvent event) { + public void processTerminated(ProcessEvent event) { super.processTerminated(event); if (event.getExitCode() == 0) { if (((GoApplicationRunningState)state).isDebug()) { @@ -166,8 +166,8 @@ private static boolean prepareFile(@NotNull File file) { } private class MyDebugStarter extends RunProfileStarter { - @NotNull private final String myOutputFilePath; - @NotNull private final GoHistoryProcessListener myHistoryProcessListener; + private final String myOutputFilePath; + private final GoHistoryProcessListener myHistoryProcessListener; private MyDebugStarter(@NotNull String outputFilePath, @NotNull GoHistoryProcessListener historyProcessListener) { @@ -210,8 +210,8 @@ public XDebugProcess start(@NotNull XDebugSession session) throws ExecutionExcep } private class MyRunStarter extends RunProfileStarter { - @NotNull private final String myOutputFilePath; - @NotNull private final GoHistoryProcessListener myHistoryProcessListener; + private final String myOutputFilePath; + private final GoHistoryProcessListener myHistoryProcessListener; private MyRunStarter(@NotNull String outputFilePath, @NotNull GoHistoryProcessListener historyProcessListener) { diff --git a/src/com/goide/runconfig/GoConfigurationFactoryBase.java b/src/com/goide/runconfig/GoConfigurationFactoryBase.java index c78dc3b812..b79638dd57 100644 --- a/src/com/goide/runconfig/GoConfigurationFactoryBase.java +++ b/src/com/goide/runconfig/GoConfigurationFactoryBase.java @@ -21,15 +21,14 @@ import com.intellij.execution.configurations.ConfigurationFactory; import com.intellij.execution.configurations.ConfigurationType; import com.intellij.openapi.util.Key; -import org.jetbrains.annotations.NotNull; public abstract class GoConfigurationFactoryBase extends ConfigurationFactory { - protected GoConfigurationFactoryBase(@NotNull ConfigurationType type) { + protected GoConfigurationFactoryBase(ConfigurationType type) { super(type); } @Override - public void configureBeforeRunTaskDefaults(Key providerID, @NotNull BeforeRunTask task) { + public void configureBeforeRunTaskDefaults(Key providerID, BeforeRunTask task) { super.configureBeforeRunTaskDefaults(providerID, task); if (providerID == CompileStepBeforeRun.ID) { task.setEnabled(false); diff --git a/src/com/goide/runconfig/GoConsoleFilter.java b/src/com/goide/runconfig/GoConsoleFilter.java index dd7c3cdddc..876229c0d7 100644 --- a/src/com/goide/runconfig/GoConsoleFilter.java +++ b/src/com/goide/runconfig/GoConsoleFilter.java @@ -182,8 +182,8 @@ private VirtualFile findInGoPath(@NotNull String fileName) { } public static class GoGetHyperlinkInfo implements HyperlinkInfo { - @NotNull private final String myPackageName; - @NotNull private final Module myModule; + private final String myPackageName; + private final Module myModule; public GoGetHyperlinkInfo(@NotNull String packageName, @NotNull Module module) { myPackageName = packageName; @@ -196,7 +196,7 @@ public String getPackageName() { } @Override - public void navigate(@NotNull Project project) { + public void navigate(Project project) { GoGetPackageFix.applyFix(project, myModule, myPackageName, false); } } diff --git a/src/com/goide/runconfig/GoModuleBasedConfiguration.java b/src/com/goide/runconfig/GoModuleBasedConfiguration.java index 5341402de1..df06434ab9 100644 --- a/src/com/goide/runconfig/GoModuleBasedConfiguration.java +++ b/src/com/goide/runconfig/GoModuleBasedConfiguration.java @@ -18,10 +18,9 @@ import com.intellij.execution.configurations.RunConfigurationModule; import com.intellij.openapi.project.Project; -import org.jetbrains.annotations.NotNull; public class GoModuleBasedConfiguration extends RunConfigurationModule { - public GoModuleBasedConfiguration(@NotNull Project project) { + public GoModuleBasedConfiguration(Project project) { super(project); } } \ No newline at end of file diff --git a/src/com/goide/runconfig/GoRunConfigurationBase.java b/src/com/goide/runconfig/GoRunConfigurationBase.java index 52cd6b23ee..38151e6c62 100644 --- a/src/com/goide/runconfig/GoRunConfigurationBase.java +++ b/src/com/goide/runconfig/GoRunConfigurationBase.java @@ -58,7 +58,7 @@ public abstract class GoRunConfigurationBase myCustomEnvironment = ContainerUtil.newHashMap(); private boolean myPassParentEnvironment = true; - public GoRunConfigurationBase(String name, @NotNull GoModuleBasedConfiguration configurationModule, @NotNull ConfigurationFactory factory) { + public GoRunConfigurationBase(String name, GoModuleBasedConfiguration configurationModule, ConfigurationFactory factory) { super(name, configurationModule, factory); Module module = configurationModule.getModule(); @@ -112,7 +112,7 @@ public void checkConfiguration() throws RuntimeConfigurationException { } @Override - public void writeExternal(@NotNull Element element) throws WriteExternalException { + public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); writeModule(element); if (StringUtil.isNotEmpty(myWorkingDirectory)) { diff --git a/src/com/goide/runconfig/GoRunConfigurationWithMain.java b/src/com/goide/runconfig/GoRunConfigurationWithMain.java index 852a7cd910..c12afed228 100644 --- a/src/com/goide/runconfig/GoRunConfigurationWithMain.java +++ b/src/com/goide/runconfig/GoRunConfigurationWithMain.java @@ -35,7 +35,7 @@ public abstract class GoRunConfigurationWithMain exten @NotNull private String myFilePath = ""; - public GoRunConfigurationWithMain(String name, @NotNull GoModuleBasedConfiguration configurationModule, @NotNull ConfigurationFactory factory) { + public GoRunConfigurationWithMain(String name, GoModuleBasedConfiguration configurationModule, ConfigurationFactory factory) { super(name, configurationModule, factory); myFilePath = getWorkingDirectory(); } @@ -47,7 +47,7 @@ public void readExternal(@NotNull Element element) throws InvalidDataException { } @Override - public void writeExternal(@NotNull Element element) throws WriteExternalException { + public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); if (StringUtil.isNotEmpty(myFilePath)) { JDOMExternalizerUtil.addElementWithValueAttribute(element, FILE_PATH_ATTRIBUTE_NAME, myFilePath); diff --git a/src/com/goide/runconfig/GoRunUtil.java b/src/com/goide/runconfig/GoRunUtil.java index fc0a21c26f..b924d9744e 100644 --- a/src/com/goide/runconfig/GoRunUtil.java +++ b/src/com/goide/runconfig/GoRunUtil.java @@ -85,10 +85,10 @@ public static PsiElement getContextElement(@Nullable ConfigurationContext contex return psiElement; } - public static void installGoWithMainFileChooser(@NotNull final Project project, @NotNull TextFieldWithBrowseButton fileField) { + public static void installGoWithMainFileChooser(final Project project, @NotNull TextFieldWithBrowseButton fileField) { installFileChooser(project, fileField, false, false, new Condition() { @Override - public boolean value(@NotNull VirtualFile file) { + public boolean value(VirtualFile file) { if (file.getFileType() != GoFileType.INSTANCE) { return false; } diff --git a/src/com/goide/runconfig/GoRunningState.java b/src/com/goide/runconfig/GoRunningState.java index 03ac2b9282..6796cfd2d2 100644 --- a/src/com/goide/runconfig/GoRunningState.java +++ b/src/com/goide/runconfig/GoRunningState.java @@ -59,7 +59,6 @@ public GoExecutor createCommonExecutor() { .withPassParentEnvironment(myConfiguration.isPassParentEnvironment()); } - @NotNull protected GoExecutor patchExecutor(@NotNull GoExecutor executor) throws ExecutionException { return executor; } diff --git a/src/com/goide/runconfig/application/GoApplicationConfiguration.java b/src/com/goide/runconfig/application/GoApplicationConfiguration.java index fd3f20c2b2..1c941ff3d5 100644 --- a/src/com/goide/runconfig/application/GoApplicationConfiguration.java +++ b/src/com/goide/runconfig/application/GoApplicationConfiguration.java @@ -60,7 +60,7 @@ public void readExternal(@NotNull Element element) throws InvalidDataException { } @Override - public void writeExternal(@NotNull Element element) throws WriteExternalException { + public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); JDOMExternalizerUtil.addElementWithValueAttribute(element, KIND_ATTRIBUTE_NAME, myKind.name()); if (!myPackage.isEmpty()) { diff --git a/src/com/goide/runconfig/application/GoApplicationRunConfigurationProducer.java b/src/com/goide/runconfig/application/GoApplicationRunConfigurationProducer.java index aa9f8bd48d..d37b6fd093 100644 --- a/src/com/goide/runconfig/application/GoApplicationRunConfigurationProducer.java +++ b/src/com/goide/runconfig/application/GoApplicationRunConfigurationProducer.java @@ -71,7 +71,7 @@ else if (contextElement instanceof PsiDirectory) { } @Override - public boolean isConfigurationFromContext(@NotNull GoApplicationConfiguration configuration, @NotNull ConfigurationContext context) { + public boolean isConfigurationFromContext(@NotNull GoApplicationConfiguration configuration, ConfigurationContext context) { PsiElement contextElement = GoRunUtil.getContextElement(context); if (contextElement == null) return false; diff --git a/src/com/goide/runconfig/application/GoApplicationRunningState.java b/src/com/goide/runconfig/application/GoApplicationRunningState.java index 74a123cdcf..43182a4199 100644 --- a/src/com/goide/runconfig/application/GoApplicationRunningState.java +++ b/src/com/goide/runconfig/application/GoApplicationRunningState.java @@ -68,7 +68,7 @@ public boolean isDebug() { protected ProcessHandler startProcess() throws ExecutionException { final ProcessHandler processHandler = super.startProcess(); processHandler.addProcessListener(new ProcessAdapter() { - @NotNull private AtomicBoolean firstOutput = new AtomicBoolean(true); + private AtomicBoolean firstOutput = new AtomicBoolean(true); @Override public void onTextAvailable(ProcessEvent event, Key outputType) { @@ -95,7 +95,6 @@ public void processTerminated(ProcessEvent event) { return processHandler; } - @NotNull @Override protected GoExecutor patchExecutor(@NotNull GoExecutor executor) throws ExecutionException { if (isDebug()) { diff --git a/src/com/goide/runconfig/before/GoBeforeRunTaskProvider.java b/src/com/goide/runconfig/before/GoBeforeRunTaskProvider.java index 2a1a5b84ba..19298a519f 100644 --- a/src/com/goide/runconfig/before/GoBeforeRunTaskProvider.java +++ b/src/com/goide/runconfig/before/GoBeforeRunTaskProvider.java @@ -36,7 +36,6 @@ import com.intellij.util.Consumer; import com.intellij.util.concurrency.Semaphore; import com.intellij.util.ui.UIUtil; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -44,21 +43,18 @@ public class GoBeforeRunTaskProvider extends BeforeRunTaskProvider { public static final Key ID = Key.create("GoBeforeRunTask"); - @NotNull @Override public Key getId() { return ID; } - @NotNull @Override public String getName() { return "Go Command"; } - @NotNull @Override - public String getDescription(@NotNull GoCommandBeforeRunTask task) { + public String getDescription(GoCommandBeforeRunTask task) { return "Run `" + task.toString() + "`"; } @@ -86,7 +82,7 @@ public GoCommandBeforeRunTask createTask(RunConfiguration runConfiguration) { } @Override - public boolean configureTask(@NotNull RunConfiguration configuration, @NotNull GoCommandBeforeRunTask task) { + public boolean configureTask(RunConfiguration configuration, GoCommandBeforeRunTask task) { Project project = configuration.getProject(); if (!(configuration instanceof GoRunConfigurationBase)) { showAddingTaskErrorMessage(project, "Go Command task supports only Go Run Configurations"); @@ -108,7 +104,7 @@ public boolean configureTask(@NotNull RunConfiguration configuration, @NotNull G } @Override - public boolean canExecuteTask(RunConfiguration configuration, @NotNull GoCommandBeforeRunTask task) { + public boolean canExecuteTask(RunConfiguration configuration, GoCommandBeforeRunTask task) { if (configuration instanceof GoRunConfigurationBase) { Module module = ((GoRunConfigurationBase)configuration).getConfigurationModule().getModule(); GoSdkService sdkService = GoSdkService.getInstance(configuration.getProject()); @@ -121,9 +117,9 @@ public boolean canExecuteTask(RunConfiguration configuration, @NotNull GoCommand @Override public boolean executeTask(DataContext context, - @NotNull RunConfiguration configuration, + RunConfiguration configuration, ExecutionEnvironment env, - @NotNull final GoCommandBeforeRunTask task) { + final GoCommandBeforeRunTask task) { final Semaphore done = new Semaphore(); final Ref result = new Ref(false); @@ -147,7 +143,7 @@ public void run() { .withPresentableName("Executing `" + task.toString() + "`") .withProcessListener(new ProcessAdapter() { @Override - public void processTerminated(@NotNull ProcessEvent event) { + public void processTerminated(ProcessEvent event) { done.up(); result.set(event.getExitCode() == 0); } diff --git a/src/com/goide/runconfig/before/GoCommandBeforeRunTask.java b/src/com/goide/runconfig/before/GoCommandBeforeRunTask.java index 405aba6625..36b4f3094f 100644 --- a/src/com/goide/runconfig/before/GoCommandBeforeRunTask.java +++ b/src/com/goide/runconfig/before/GoCommandBeforeRunTask.java @@ -20,7 +20,6 @@ import com.intellij.openapi.util.text.StringUtil; import org.jdom.Element; import org.jetbrains.annotations.NonNls; -import org.jetbrains.annotations.NotNull; public class GoCommandBeforeRunTask extends BeforeRunTask { @NonNls @@ -41,7 +40,7 @@ public void setCommand(String command) { } @Override - public void writeExternal(@NotNull Element element) { + public void writeExternal(Element element) { super.writeExternal(element); if (myCommand != null) { element.setAttribute(COMMAND_ATTRIBUTE, myCommand); @@ -49,7 +48,7 @@ public void writeExternal(@NotNull Element element) { } @Override - public void readExternal(@NotNull Element element) { + public void readExternal(Element element) { super.readExternal(element); String command = element.getAttributeValue(COMMAND_ATTRIBUTE); if (command != null) { @@ -57,7 +56,6 @@ public void readExternal(@NotNull Element element) { } } - @NotNull @Override public String toString() { return "go " + StringUtil.notNullize(myCommand); diff --git a/src/com/goide/runconfig/before/GoCommandConfigureDialog.java b/src/com/goide/runconfig/before/GoCommandConfigureDialog.java index 10081a4b20..dab5c1fb17 100644 --- a/src/com/goide/runconfig/before/GoCommandConfigureDialog.java +++ b/src/com/goide/runconfig/before/GoCommandConfigureDialog.java @@ -31,7 +31,7 @@ public class GoCommandConfigureDialog extends DialogWrapper { private static final Collection PREDEFINED_COMMANDS = Arrays.asList("vet", "test -i"); - @NotNull private final TextFieldWithAutoCompletion myCommandTextField; + private final TextFieldWithAutoCompletion myCommandTextField; public GoCommandConfigureDialog(@NotNull Project project) { super(project); diff --git a/src/com/goide/runconfig/file/GoRunFileRunningState.java b/src/com/goide/runconfig/file/GoRunFileRunningState.java index 159d61685e..c675ccbe02 100644 --- a/src/com/goide/runconfig/file/GoRunFileRunningState.java +++ b/src/com/goide/runconfig/file/GoRunFileRunningState.java @@ -24,11 +24,10 @@ import org.jetbrains.annotations.NotNull; public class GoRunFileRunningState extends GoRunningState { - public GoRunFileRunningState(@NotNull ExecutionEnvironment env, @NotNull Module module, @NotNull GoRunFileConfiguration configuration) { + public GoRunFileRunningState(@NotNull ExecutionEnvironment env, @NotNull Module module, GoRunFileConfiguration configuration) { super(env, module, configuration); } - @NotNull @Override protected GoExecutor patchExecutor(@NotNull GoExecutor executor) throws ExecutionException { return executor diff --git a/src/com/goide/runconfig/testing/GoTestRunConfiguration.java b/src/com/goide/runconfig/testing/GoTestRunConfiguration.java index 78939bdac5..69463bd0e4 100644 --- a/src/com/goide/runconfig/testing/GoTestRunConfiguration.java +++ b/src/com/goide/runconfig/testing/GoTestRunConfiguration.java @@ -54,24 +54,22 @@ public class GoTestRunConfiguration extends GoRunConfigurationBase { - @Nullable private String myCoverageFilePath; + private String myCoverageFilePath; public GoTestRunningState(@NotNull ExecutionEnvironment env, @NotNull Module module, @NotNull GoTestRunConfiguration configuration) { super(env, module, configuration); @@ -74,7 +74,6 @@ consoleProperties, getEnvironment(), return executionResult; } - @NotNull @Override protected GoExecutor patchExecutor(@NotNull GoExecutor executor) throws ExecutionException { executor.withParameters("test", "-v"); @@ -126,7 +125,7 @@ protected GoExecutor patchExecutor(@NotNull GoExecutor executor) throws Executio } @NotNull - protected String buildFilePattern(@NotNull GoFile file) { + protected String buildFilePattern(GoFile file) { Collection testNames = ContainerUtil.newLinkedHashSet(); for (GoFunctionDeclaration function : file.getFunctions()) { ContainerUtil.addIfNotNull(testNames, GoTestFinder.getTestFunctionName(function)); diff --git a/src/com/goide/runconfig/testing/coverage/GoCoverageAnnotator.java b/src/com/goide/runconfig/testing/coverage/GoCoverageAnnotator.java index 24c48a6aa7..ee9444bb71 100644 --- a/src/com/goide/runconfig/testing/coverage/GoCoverageAnnotator.java +++ b/src/com/goide/runconfig/testing/coverage/GoCoverageAnnotator.java @@ -55,7 +55,7 @@ public GoCoverageAnnotator(@NotNull Project project) { super(project); } - public static GoCoverageAnnotator getInstance(@NotNull Project project) { + public static GoCoverageAnnotator getInstance(Project project) { return ServiceManager.getService(project, GoCoverageAnnotator.class); } @@ -143,7 +143,6 @@ protected Runnable createRenewRequest(@NotNull CoverageSuitesBundle bundle, @Not return new Runnable() { public void run() { annotateAllFiles(data, (VirtualFile[])manager.doInReadActionIfProjectOpen(new Computable() { - @NotNull public VirtualFile[] compute() { return ProjectRootManager.getInstance(getProject()).getContentRoots(); } @@ -154,9 +153,8 @@ public VirtualFile[] compute() { } @NotNull - private DirCoverageInfo getOrCreateDirectoryInfo(@NotNull VirtualFile file) { + private DirCoverageInfo getOrCreateDirectoryInfo(VirtualFile file) { return ContainerUtil.getOrCreate(myDirCoverageInfos, file.getPath(), new Factory() { - @NotNull @Override public DirCoverageInfo create() { return new DirCoverageInfo(); @@ -165,9 +163,8 @@ public DirCoverageInfo create() { } @NotNull - private FileCoverageInfo getOrCreateFileInfo(@NotNull VirtualFile file) { + private FileCoverageInfo getOrCreateFileInfo(VirtualFile file) { return ContainerUtil.getOrCreate(myFileCoverageInfos, file.getPath(), new Factory() { - @NotNull @Override public FileCoverageInfo create() { return new FileCoverageInfo(); @@ -212,7 +209,7 @@ public Result visitFileEx(@NotNull VirtualFile file) { final FileCoverageInfo fileCoverageInfo = getOrCreateFileInfo(file); data.processFile(file.getPath(), new Processor() { @Override - public boolean process(@NotNull GoCoverageProjectData.RangeData rangeData) { + public boolean process(GoCoverageProjectData.RangeData rangeData) { if (rangeData.hits > 0) { fileCoverageInfo.coveredLineCount += rangeData.statements; } diff --git a/src/com/goide/runconfig/testing/coverage/GoCoverageEnabledConfiguration.java b/src/com/goide/runconfig/testing/coverage/GoCoverageEnabledConfiguration.java index ebf4a74481..e66f0b3e92 100644 --- a/src/com/goide/runconfig/testing/coverage/GoCoverageEnabledConfiguration.java +++ b/src/com/goide/runconfig/testing/coverage/GoCoverageEnabledConfiguration.java @@ -19,10 +19,9 @@ import com.goide.runconfig.testing.GoTestRunConfiguration; import com.intellij.coverage.CoverageRunner; import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; -import org.jetbrains.annotations.NotNull; public class GoCoverageEnabledConfiguration extends CoverageEnabledConfiguration { - public GoCoverageEnabledConfiguration(@NotNull GoTestRunConfiguration configuration) { + public GoCoverageEnabledConfiguration(GoTestRunConfiguration configuration) { super(configuration); setCoverageRunner(CoverageRunner.getInstance(GoCoverageRunner.class)); } diff --git a/src/com/goide/runconfig/testing/coverage/GoCoverageEngine.java b/src/com/goide/runconfig/testing/coverage/GoCoverageEngine.java index 39617f690f..9dd3d0deae 100644 --- a/src/com/goide/runconfig/testing/coverage/GoCoverageEngine.java +++ b/src/com/goide/runconfig/testing/coverage/GoCoverageEngine.java @@ -48,7 +48,7 @@ public class GoCoverageEngine extends CoverageEngine { private static final Condition NODE_TO_COVERAGE = new Condition() { @Override - public boolean value(@NotNull AbstractTreeNode node) { + public boolean value(AbstractTreeNode node) { Object value = node.getValue(); if (value instanceof PsiFile) { return isProductionGoFile(((PsiFile)value)); @@ -158,7 +158,6 @@ public List collectSrcLinesForUntouchedFile(@NotNull File classFile, @N return null; } - @NotNull @Override public List findTestsByNames(@NotNull String[] testNames, @NotNull Project project) { return Collections.emptyList(); @@ -169,24 +168,21 @@ public String getTestMethodName(@NotNull PsiElement element, @NotNull AbstractTe return null; } - @NotNull @Override public String getPresentableText() { return PRESENTABLE_TEXT; } @Override - public boolean coverageProjectViewStatisticsApplicableTo(@NotNull VirtualFile fileOrDir) { + public boolean coverageProjectViewStatisticsApplicableTo(VirtualFile fileOrDir) { return !(fileOrDir.isDirectory()) && fileOrDir.getFileType() == GoFileType.INSTANCE && !GoTestFinder.isTestFile(fileOrDir); } - @NotNull @Override public CoverageViewExtension createCoverageViewExtension(Project project, CoverageSuitesBundle suiteBundle, CoverageViewManager.StateBean stateBean) { return new DirectoryCoverageViewExtension(project, getCoverageAnnotator(project), suiteBundle, stateBean) { - @NotNull @Override public List getChildrenNodes(AbstractTreeNode node) { return ContainerUtil.filter(super.getChildrenNodes(node), NODE_TO_COVERAGE); diff --git a/src/com/goide/runconfig/testing/coverage/GoCoverageProjectData.java b/src/com/goide/runconfig/testing/coverage/GoCoverageProjectData.java index 6d85d15502..db1a461d00 100644 --- a/src/com/goide/runconfig/testing/coverage/GoCoverageProjectData.java +++ b/src/com/goide/runconfig/testing/coverage/GoCoverageProjectData.java @@ -48,9 +48,8 @@ public void processFile(@NotNull String filePath, @NotNull Processor } } - public void addData(@NotNull final String filePath, int startLine, int startColumn, int endLine, int endColumn, int statements, int hits) { + public void addData(final String filePath, int startLine, int startColumn, int endLine, int endColumn, int statements, int hits) { FileData fileData = ContainerUtil.getOrCreate(myFilesData, filePath, new Factory() { - @NotNull @Override public FileData create() { return new FileData(filePath); @@ -60,7 +59,7 @@ public FileData create() { } @Override - public void merge(@NotNull CoverageData data) { + public void merge(CoverageData data) { super.merge(data); if (data instanceof GoCoverageProjectData) { for (Map.Entry entry : ((GoCoverageProjectData)data).myFilesData.entrySet()) { @@ -186,14 +185,12 @@ public int hashCode() { return result; } - @NotNull @Override public String toString() { return rangeKey(startLine, startColumn, endLine, endColumn) + "; hits: " + hits + "; statements: " + statements; } } - @NotNull private static String rangeKey(int startLine, int startColumn, int endLine, int endColumn) { return startLine + ":" + startColumn + "-" + endLine + ":" + endColumn; } diff --git a/src/com/goide/runconfig/testing/coverage/GoCoverageRunner.java b/src/com/goide/runconfig/testing/coverage/GoCoverageRunner.java index 60384ec150..c45c3c1e45 100644 --- a/src/com/goide/runconfig/testing/coverage/GoCoverageRunner.java +++ b/src/com/goide/runconfig/testing/coverage/GoCoverageRunner.java @@ -48,7 +48,6 @@ public class GoCoverageRunner extends CoverageRunner { private static final String DATA_FILE_EXTENSION = "out"; private static final String PRESENTABLE_NAME = GoConstants.GO; - @Nullable @Override public ProjectData loadCoverageData(@NotNull File sessionDataFile, @Nullable CoverageSuite baseCoverageSuite) { if (baseCoverageSuite == null || !(baseCoverageSuite instanceof BaseCoverageSuite)) { @@ -123,7 +122,7 @@ public static GoCoverageProjectData parseCoverage(@NotNull BufferedReader dataRe result.processFiles(new Processor() { @Override - public boolean process(@NotNull GoCoverageProjectData.FileData fileData) { + public boolean process(GoCoverageProjectData.FileData fileData) { ClassData classData = result.getOrCreateClassData(fileData.myFilePath); int max = -1; TIntObjectHashMap linesMap = new TIntObjectHashMap(); @@ -148,7 +147,7 @@ public boolean process(@NotNull GoCoverageProjectData.FileData fileData) { final LineData[] linesArray = new LineData[max + 1]; linesMap.forEachValue(new TObjectProcedure() { @Override - public boolean execute(@NotNull LineData data) { + public boolean execute(LineData data) { data.fillArrays(); linesArray[data.getLineNumber()] = data; return true; @@ -167,13 +166,11 @@ public String getPresentableName() { return PRESENTABLE_NAME; } - @NotNull @Override public String getId() { return ID; } - @NotNull @Override public String getDataFileExtension() { return DATA_FILE_EXTENSION; diff --git a/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckEventsConverter.java b/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckEventsConverter.java index d9ed368828..767e635636 100644 --- a/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckEventsConverter.java +++ b/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckEventsConverter.java @@ -74,19 +74,19 @@ private enum Scope { private static final Pattern ERROR_CONTINUATION = Pattern.compile("\\.\\.\\. {5}(.*?)( +\\+)?\\s*$"); private static final Pattern PANIC_VALUE = Pattern.compile("(.*)\\.\\.\\. (Panic: .* \\(.*\\)\\s*)$"); - @NotNull private Scope myScope = Scope.GLOBAL; + private Scope myScope = Scope.GLOBAL; private String mySuiteName; private String myTestName; private long myCurrentTestStart; - @Nullable private TestResult myFixtureFailure; - @Nullable private List myStdOut; + private TestResult myFixtureFailure; + private List myStdOut; private enum Status { PASSED, FAILED, PANICKED, MISSED, SKIPPED } private static final class TestResult { - @NotNull private final Status myStatus; + private final Status myStatus; private final Map myAttributes = ContainerUtil.newHashMap(); TestResult(@NotNull Status status) { @@ -234,7 +234,7 @@ public boolean processServiceMessages(@NotNull String text, Key outputType, Serv } @Nullable - private TestResult detectTestResult(@NotNull String text, boolean parseDetails) { + private TestResult detectTestResult(String text, boolean parseDetails) { Matcher matcher; if ((matcher = TEST_PASSED.matcher(text)).matches()) { myStdOut.add(StringUtil.notNullize(matcher.group(1)).trim()); @@ -416,8 +416,8 @@ private Map parseFailureAttributes() { pair("details", details)); } - private static int collectErrorMessage(@NotNull List lines, int currentLine, @NotNull Pattern continuationPattern, @NotNull Pattern messagePattern, - @NotNull StringBuilder result) { + private static int collectErrorMessage(List lines, int currentLine, Pattern continuationPattern, Pattern messagePattern, + StringBuilder result) { while (currentLine >= 0) { String line = lines.get(currentLine); diff --git a/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckFramework.java b/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckFramework.java index 98b21fe5b9..676b6c0899 100644 --- a/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckFramework.java +++ b/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckFramework.java @@ -75,7 +75,7 @@ public boolean isAvailable(@Nullable Module module) { return false; } - private static boolean isGoCheckImportPath(@Nullable String importPath) { + private static boolean isGoCheckImportPath(String importPath) { if (importPath == null) return false; return GO_CHECK_IMPORT_PATH.matcher(importPath).matches() || GO_CHECK_GITHUB_IMPORT_PATH.matcher(importPath).matches(); } diff --git a/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckRunningState.java b/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckRunningState.java index bc14c59cd1..1a3dd6ae64 100644 --- a/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckRunningState.java +++ b/src/com/goide/runconfig/testing/frameworks/gocheck/GocheckRunningState.java @@ -37,7 +37,6 @@ public GocheckRunningState(@NotNull ExecutionEnvironment env, super(env, module, configuration); } - @NotNull @Override protected GoExecutor patchExecutor(@NotNull GoExecutor executor) throws ExecutionException { return super.patchExecutor(executor).withParameters("-check.vv"); @@ -45,7 +44,7 @@ protected GoExecutor patchExecutor(@NotNull GoExecutor executor) throws Executio @NotNull @Override - protected String buildFilePattern(@NotNull GoFile file) { + protected String buildFilePattern(GoFile file) { Collection testNames = ContainerUtil.newLinkedHashSet(); for (GoMethodDeclaration method : file.getMethods()) { ContainerUtil.addIfNotNull(testNames, GocheckFramework.getGocheckTestName(method)); diff --git a/src/com/goide/runconfig/testing/frameworks/gotest/GotestEventsConverter.java b/src/com/goide/runconfig/testing/frameworks/gotest/GotestEventsConverter.java index 207e95ed73..1e20bd414b 100644 --- a/src/com/goide/runconfig/testing/frameworks/gotest/GotestEventsConverter.java +++ b/src/com/goide/runconfig/testing/frameworks/gotest/GotestEventsConverter.java @@ -51,7 +51,7 @@ public GotestEventsConverter(@NotNull TestConsoleProperties consoleProperties) { } @Override - public boolean processServiceMessages(@NotNull String text, @NotNull Key outputType, @NotNull ServiceMessageVisitor visitor) throws ParseException { + public boolean processServiceMessages(@NotNull String text, Key outputType, ServiceMessageVisitor visitor) throws ParseException { Matcher matcher; if ((matcher = RUN.matcher(text)).find()) { @@ -98,7 +98,7 @@ public boolean processServiceMessages(@NotNull String text, @NotNull Key outputT } @NotNull - private String testFinishedMessage(@NotNull String testName) { + private String testFinishedMessage(String testName) { long duration = System.currentTimeMillis() - myCurrentTestStart; return ServiceMessageBuilder.testFinished(testName).addAttribute("duration", Long.toString(duration)).toString(); } @@ -108,7 +108,7 @@ private static String testUrl(@NotNull String testName) { return GoTestLocationProvider.PROTOCOL + "://" + testName; } - private boolean processNotFinishedMessage(@NotNull String message, Key outputType, ServiceMessageVisitor visitor) throws ParseException { + private boolean processNotFinishedMessage(String message, Key outputType, ServiceMessageVisitor visitor) throws ParseException { if (myFailed || mySkipped) { processFailedMessage(outputType, visitor); } @@ -128,7 +128,7 @@ private boolean processFailedMessage(Key outputType, ServiceMessageVisitor visit && super.processServiceMessages(testFinishedMessage(myCurrentTest), outputType, visitor); } - private boolean handleFinishTest(@NotNull String text, @NotNull Matcher matcher, @NotNull String testName, @NotNull Key outputType, @NotNull ServiceMessageVisitor visitor) + private boolean handleFinishTest(String text, Matcher matcher, String testName, Key outputType, ServiceMessageVisitor visitor) throws ParseException { addNewLineIfNeeded(testName, outputType, visitor); if (matcher.start() > 0) { diff --git a/src/com/goide/runconfig/testing/ui/GoTestRunConfigurationEditorForm.java b/src/com/goide/runconfig/testing/ui/GoTestRunConfigurationEditorForm.java index 0be6c896af..f18f04ff80 100644 --- a/src/com/goide/runconfig/testing/ui/GoTestRunConfigurationEditorForm.java +++ b/src/com/goide/runconfig/testing/ui/GoTestRunConfigurationEditorForm.java @@ -41,7 +41,7 @@ public class GoTestRunConfigurationEditorForm extends SettingsEditor { @NotNull private final Project myProject; private JPanel myComponent; - @Nullable private EditorTextField myPatternEditor; + private EditorTextField myPatternEditor; private JComboBox myTestKindComboBox; private JLabel myFileLabel; diff --git a/src/com/goide/runconfig/ui/GoRunFileConfigurationEditorForm.java b/src/com/goide/runconfig/ui/GoRunFileConfigurationEditorForm.java index c45be550b2..e219fc33df 100644 --- a/src/com/goide/runconfig/ui/GoRunFileConfigurationEditorForm.java +++ b/src/com/goide/runconfig/ui/GoRunFileConfigurationEditorForm.java @@ -37,13 +37,13 @@ public GoRunFileConfigurationEditorForm(@NotNull Project project) { } @Override - protected void resetEditorFrom(@NotNull GoRunFileConfiguration configuration) { + protected void resetEditorFrom(GoRunFileConfiguration configuration) { myFileField.setText(configuration.getFilePath()); myCommonSettingsPanel.resetEditorFrom(configuration); } @Override - protected void applyEditorTo(@NotNull GoRunFileConfiguration configuration) throws ConfigurationException { + protected void applyEditorTo(GoRunFileConfiguration configuration) throws ConfigurationException { configuration.setFilePath(myFileField.getText()); myCommonSettingsPanel.applyEditorTo(configuration); } diff --git a/src/com/goide/sdk/GoEnvironmentGoPathModificationTracker.java b/src/com/goide/sdk/GoEnvironmentGoPathModificationTracker.java index 5b5f8b0529..0b450423d8 100644 --- a/src/com/goide/sdk/GoEnvironmentGoPathModificationTracker.java +++ b/src/com/goide/sdk/GoEnvironmentGoPathModificationTracker.java @@ -69,7 +69,7 @@ public void fileCopied(@NotNull VirtualFileCopyEvent event) { handleEvent(event); } - private void handleEvent(@NotNull VirtualFileEvent event) { + private void handleEvent(VirtualFileEvent event) { if (pathsToTrack.contains(event.getFile().getPath())) { recalculateFiles(); } @@ -77,7 +77,6 @@ private void handleEvent(@NotNull VirtualFileEvent event) { }); } - @NotNull private Collection recalculateFiles() { Collection result = ContainerUtil.newLinkedHashSet(); for (String path : pathsToTrack) { @@ -87,17 +86,15 @@ private Collection recalculateFiles() { return result; } - private synchronized void updateGoPathRoots(@NotNull Collection newRoots) { + private synchronized void updateGoPathRoots(Collection newRoots) { goPathRoots.clear(); goPathRoots.addAll(newRoots); } - @NotNull private synchronized Collection getGoPathRoots() { return goPathRoots; } - @NotNull public static Collection getGoEnvironmentGoPathRoots() { return ServiceManager.getService(GoEnvironmentGoPathModificationTracker.class).getGoPathRoots(); } diff --git a/src/com/goide/sdk/GoSdkService.java b/src/com/goide/sdk/GoSdkService.java index 4a794b9164..1846e0e003 100644 --- a/src/com/goide/sdk/GoSdkService.java +++ b/src/com/goide/sdk/GoSdkService.java @@ -97,7 +97,6 @@ public String getGoExecutablePath(@Nullable Module module) { return getGoExecutablePath(getSdkHomePath(module)); } - @Nullable public static String getGoExecutablePath(@Nullable String sdkHomePath) { if (sdkHomePath != null) { if (isLooksLikeAppEngineSdkPath(sdkHomePath)) { diff --git a/src/com/goide/sdk/GoSdkType.java b/src/com/goide/sdk/GoSdkType.java index b71b0675e6..7263b22ba4 100644 --- a/src/com/goide/sdk/GoSdkType.java +++ b/src/com/goide/sdk/GoSdkType.java @@ -80,9 +80,8 @@ public boolean isValidSdkHome(@NotNull String path) { return false; } - @NotNull @Override - public String adjustSelectedSdkHome(@NotNull String homePath) { + public String adjustSelectedSdkHome(String homePath) { return GoSdkUtil.adjustSdkPath(homePath); } diff --git a/src/com/goide/sdk/GoSdkUtil.java b/src/com/goide/sdk/GoSdkUtil.java index 0cbc13cfb7..ac9c2eba72 100644 --- a/src/com/goide/sdk/GoSdkUtil.java +++ b/src/com/goide/sdk/GoSdkUtil.java @@ -368,7 +368,7 @@ public static Collection getSdkDirectoriesToAttach(@NotNull String } @NotNull - public static Collection getSdkAndLibrariesCacheDependencies(@NotNull PsiElement context, @NotNull Object... extra) { + public static Collection getSdkAndLibrariesCacheDependencies(@NotNull PsiElement context, Object... extra) { return getSdkAndLibrariesCacheDependencies(context.getProject(), ModuleUtilCore.findModuleForPsiElement(context), ArrayUtil.append(extra, context)); } @@ -400,9 +400,8 @@ public RetrieveSubDirectoryOrSelfFunction(@NotNull String subdirName) { mySubdirName = subdirName; } - @Nullable @Override - public VirtualFile fun(@Nullable VirtualFile file) { + public VirtualFile fun(VirtualFile file) { return file == null || FileUtil.namesEqual(mySubdirName, file.getName()) ? file : file.findChild(mySubdirName); } } diff --git a/src/com/goide/stubs/GoAnonymousFieldDefinitionStub.java b/src/com/goide/stubs/GoAnonymousFieldDefinitionStub.java index 71774ab61c..55e6d2fce9 100644 --- a/src/com/goide/stubs/GoAnonymousFieldDefinitionStub.java +++ b/src/com/goide/stubs/GoAnonymousFieldDefinitionStub.java @@ -20,14 +20,13 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; -import org.jetbrains.annotations.NotNull; public class GoAnonymousFieldDefinitionStub extends GoNamedStub { - public GoAnonymousFieldDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, boolean isPublic) { + public GoAnonymousFieldDefinitionStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic) { super(parent, elementType, name, isPublic); } - public GoAnonymousFieldDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, String name, boolean isPublic) { + public GoAnonymousFieldDefinitionStub(StubElement parent, IStubElementType elementType, String name, boolean isPublic) { super(parent, elementType, name, isPublic); } } diff --git a/src/com/goide/stubs/GoConstDefinitionStub.java b/src/com/goide/stubs/GoConstDefinitionStub.java index 5d19c84b45..011168b26c 100644 --- a/src/com/goide/stubs/GoConstDefinitionStub.java +++ b/src/com/goide/stubs/GoConstDefinitionStub.java @@ -20,14 +20,13 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; -import org.jetbrains.annotations.NotNull; public class GoConstDefinitionStub extends GoNamedStub { - public GoConstDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, boolean isPublic) { + public GoConstDefinitionStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic) { super(parent, elementType, name, isPublic); } - public GoConstDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, String name, boolean isPublic) { + public GoConstDefinitionStub(StubElement parent, IStubElementType elementType, String name, boolean isPublic) { super(parent, elementType, name, isPublic); } } diff --git a/src/com/goide/stubs/GoFieldDefinitionStub.java b/src/com/goide/stubs/GoFieldDefinitionStub.java index cc114dfebf..4424afc921 100644 --- a/src/com/goide/stubs/GoFieldDefinitionStub.java +++ b/src/com/goide/stubs/GoFieldDefinitionStub.java @@ -20,14 +20,13 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; -import org.jetbrains.annotations.NotNull; public class GoFieldDefinitionStub extends GoNamedStub { - public GoFieldDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, boolean isPublic) { + public GoFieldDefinitionStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic) { super(parent, elementType, name, isPublic); } - public GoFieldDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, String name, boolean isPublic) { + public GoFieldDefinitionStub(StubElement parent, IStubElementType elementType, String name, boolean isPublic) { super(parent, elementType, name, isPublic); } } diff --git a/src/com/goide/stubs/GoFunctionOrMethodDeclarationStub.java b/src/com/goide/stubs/GoFunctionOrMethodDeclarationStub.java index 164220e51a..dd70e8f750 100644 --- a/src/com/goide/stubs/GoFunctionOrMethodDeclarationStub.java +++ b/src/com/goide/stubs/GoFunctionOrMethodDeclarationStub.java @@ -20,14 +20,13 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; -import org.jetbrains.annotations.NotNull; abstract public class GoFunctionOrMethodDeclarationStub extends GoNamedStub { - protected GoFunctionOrMethodDeclarationStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, boolean isPublic) { + protected GoFunctionOrMethodDeclarationStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic) { super(parent, elementType, name, isPublic); } - protected GoFunctionOrMethodDeclarationStub(StubElement parent, @NotNull IStubElementType elementType, String name, boolean isPublic) { + protected GoFunctionOrMethodDeclarationStub(StubElement parent, IStubElementType elementType, String name, boolean isPublic) { super(parent, elementType, name, isPublic); } } diff --git a/src/com/goide/stubs/GoImportSpecStub.java b/src/com/goide/stubs/GoImportSpecStub.java index d160a36733..438c144adf 100644 --- a/src/com/goide/stubs/GoImportSpecStub.java +++ b/src/com/goide/stubs/GoImportSpecStub.java @@ -31,7 +31,7 @@ public class GoImportSpecStub extends GoNamedStub { private final StringRef myPathRef; private final boolean myIsDot; - public GoImportSpecStub(StubElement parent, @NotNull IStubElementType elementType, @Nullable String alias, @NotNull String path, boolean isDot) { + public GoImportSpecStub(StubElement parent, IStubElementType elementType, @Nullable String alias, @NotNull String path, boolean isDot) { super(parent, elementType, (String)null, false); myAliasRef = StringRef.fromString(alias); myPathRef = StringRef.fromString(path); diff --git a/src/com/goide/stubs/GoLabelDefinitionStub.java b/src/com/goide/stubs/GoLabelDefinitionStub.java index 4d8f73f386..c9ac5a4d73 100644 --- a/src/com/goide/stubs/GoLabelDefinitionStub.java +++ b/src/com/goide/stubs/GoLabelDefinitionStub.java @@ -20,14 +20,13 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; -import org.jetbrains.annotations.NotNull; public class GoLabelDefinitionStub extends GoNamedStub { - public GoLabelDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, boolean isPublic) { + public GoLabelDefinitionStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic) { super(parent, elementType, name, isPublic); } - public GoLabelDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, String name, boolean isPublic) { + public GoLabelDefinitionStub(StubElement parent, IStubElementType elementType, String name, boolean isPublic) { super(parent, elementType, name, isPublic); } } diff --git a/src/com/goide/stubs/GoMethodDeclarationStub.java b/src/com/goide/stubs/GoMethodDeclarationStub.java index 04282769ed..29013c4466 100644 --- a/src/com/goide/stubs/GoMethodDeclarationStub.java +++ b/src/com/goide/stubs/GoMethodDeclarationStub.java @@ -23,7 +23,7 @@ import org.jetbrains.annotations.Nullable; public class GoMethodDeclarationStub extends GoFunctionOrMethodDeclarationStub { - @Nullable private final StringRef myTypeName; + private final StringRef myTypeName; public GoMethodDeclarationStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic, StringRef typeName) { super(parent, elementType, name, isPublic); diff --git a/src/com/goide/stubs/GoMethodSpecStub.java b/src/com/goide/stubs/GoMethodSpecStub.java index 3017ea4b7b..33ef66bee2 100644 --- a/src/com/goide/stubs/GoMethodSpecStub.java +++ b/src/com/goide/stubs/GoMethodSpecStub.java @@ -20,17 +20,16 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; -import org.jetbrains.annotations.NotNull; public class GoMethodSpecStub extends GoNamedStub { private final int myArity; - public GoMethodSpecStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, boolean isPublic, int arity) { + public GoMethodSpecStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic, int arity) { super(parent, elementType, name, isPublic); myArity = arity; } - public GoMethodSpecStub(StubElement parent, @NotNull IStubElementType elementType, String name, boolean isPublic, int arity) { + public GoMethodSpecStub(StubElement parent, IStubElementType elementType, String name, boolean isPublic, int arity) { super(parent, elementType, name, isPublic); myArity = arity; } diff --git a/src/com/goide/stubs/GoNamedStub.java b/src/com/goide/stubs/GoNamedStub.java index 0ca109d069..4e75350ea1 100644 --- a/src/com/goide/stubs/GoNamedStub.java +++ b/src/com/goide/stubs/GoNamedStub.java @@ -21,17 +21,16 @@ import com.intellij.psi.stubs.NamedStubBase; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; -import org.jetbrains.annotations.NotNull; abstract public class GoNamedStub extends NamedStubBase { private final boolean myIsPublic; - public GoNamedStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, boolean isPublic) { + public GoNamedStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic) { super(parent, elementType, name); myIsPublic = isPublic; } - public GoNamedStub(StubElement parent, @NotNull IStubElementType elementType, String name, boolean isPublic) { + public GoNamedStub(StubElement parent, IStubElementType elementType, String name, boolean isPublic) { super(parent, elementType, name); myIsPublic = isPublic; } diff --git a/src/com/goide/stubs/GoParamDefinitionStub.java b/src/com/goide/stubs/GoParamDefinitionStub.java index 95ca437602..b6a8e20961 100644 --- a/src/com/goide/stubs/GoParamDefinitionStub.java +++ b/src/com/goide/stubs/GoParamDefinitionStub.java @@ -20,14 +20,13 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; -import org.jetbrains.annotations.NotNull; public class GoParamDefinitionStub extends GoNamedStub { - public GoParamDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, boolean isPublic) { + public GoParamDefinitionStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic) { super(parent, elementType, name, isPublic); } - public GoParamDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, String name, boolean isPublic) { + public GoParamDefinitionStub(StubElement parent, IStubElementType elementType, String name, boolean isPublic) { super(parent, elementType, name, isPublic); } } diff --git a/src/com/goide/stubs/GoReceiverStub.java b/src/com/goide/stubs/GoReceiverStub.java index 39fc9ba49f..b1bced796a 100644 --- a/src/com/goide/stubs/GoReceiverStub.java +++ b/src/com/goide/stubs/GoReceiverStub.java @@ -20,14 +20,13 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; -import org.jetbrains.annotations.NotNull; public class GoReceiverStub extends GoNamedStub { - public GoReceiverStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, boolean isPublic) { + public GoReceiverStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic) { super(parent, elementType, name, isPublic); } - public GoReceiverStub(StubElement parent, @NotNull IStubElementType elementType, String name, boolean isPublic) { + public GoReceiverStub(StubElement parent, IStubElementType elementType, String name, boolean isPublic) { super(parent, elementType, name, isPublic); } } diff --git a/src/com/goide/stubs/GoStubElementTypeFactory.java b/src/com/goide/stubs/GoStubElementTypeFactory.java index 52af9b9c0f..589c66af29 100644 --- a/src/com/goide/stubs/GoStubElementTypeFactory.java +++ b/src/com/goide/stubs/GoStubElementTypeFactory.java @@ -28,7 +28,7 @@ import java.util.Map; public class GoStubElementTypeFactory { - @NotNull private static Map TYPES = new HashMap() { + private static Map TYPES = new HashMap() { { put("ARRAY_OR_SLICE_TYPE", GoArrayOrSliceTypeImpl.class); put("CHANNEL_TYPE", GoChannelTypeImpl.class); diff --git a/src/com/goide/stubs/GoTypeSpecStub.java b/src/com/goide/stubs/GoTypeSpecStub.java index 2733daf0a2..b511d7bb01 100644 --- a/src/com/goide/stubs/GoTypeSpecStub.java +++ b/src/com/goide/stubs/GoTypeSpecStub.java @@ -20,14 +20,13 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; -import org.jetbrains.annotations.NotNull; public class GoTypeSpecStub extends GoNamedStub { - public GoTypeSpecStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, boolean isPublic) { + public GoTypeSpecStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic) { super(parent, elementType, name, isPublic); } - public GoTypeSpecStub(StubElement parent, @NotNull IStubElementType elementType, String name, boolean isPublic) { + public GoTypeSpecStub(StubElement parent, IStubElementType elementType, String name, boolean isPublic) { super(parent, elementType, name, isPublic); } } diff --git a/src/com/goide/stubs/GoVarDefinitionStub.java b/src/com/goide/stubs/GoVarDefinitionStub.java index c498a6fe58..3f5542afa9 100644 --- a/src/com/goide/stubs/GoVarDefinitionStub.java +++ b/src/com/goide/stubs/GoVarDefinitionStub.java @@ -20,14 +20,13 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; -import org.jetbrains.annotations.NotNull; public class GoVarDefinitionStub extends GoNamedStub { - public GoVarDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, boolean isPublic) { + public GoVarDefinitionStub(StubElement parent, IStubElementType elementType, StringRef name, boolean isPublic) { super(parent, elementType, name, isPublic); } - public GoVarDefinitionStub(StubElement parent, @NotNull IStubElementType elementType, String name, boolean isPublic) { + public GoVarDefinitionStub(StubElement parent, IStubElementType elementType, String name, boolean isPublic) { super(parent, elementType, name, isPublic); } } diff --git a/src/com/goide/stubs/types/GoConstSpecStubElementType.java b/src/com/goide/stubs/types/GoConstSpecStubElementType.java index 624fcad605..5cb4abba9c 100644 --- a/src/com/goide/stubs/types/GoConstSpecStubElementType.java +++ b/src/com/goide/stubs/types/GoConstSpecStubElementType.java @@ -62,7 +62,7 @@ public void serialize(@NotNull GoConstSpecStub stub, @NotNull StubOutputStream d } @Override - public boolean shouldCreateStub(@NotNull ASTNode node) { + public boolean shouldCreateStub(ASTNode node) { return super.shouldCreateStub(node) && PsiTreeUtil.getParentOfType(node.getPsi(), GoFunctionOrMethodDeclaration.class) == null; } diff --git a/src/com/goide/stubs/types/GoStubElementType.java b/src/com/goide/stubs/types/GoStubElementType.java index 9dc9ee757e..73294c242a 100644 --- a/src/com/goide/stubs/types/GoStubElementType.java +++ b/src/com/goide/stubs/types/GoStubElementType.java @@ -41,7 +41,7 @@ public void indexStub(@NotNull S stub, @NotNull IndexSink sink) { } @Override - public boolean shouldCreateStub(@NotNull ASTNode node) { + public boolean shouldCreateStub(ASTNode node) { return super.shouldCreateStub(node) && PsiTreeUtil.getParentOfType(node.getPsi(), GoBlock.class) == null; } } diff --git a/src/com/goide/stubs/types/GoVarSpecStubElementType.java b/src/com/goide/stubs/types/GoVarSpecStubElementType.java index 5d98cdfb7a..d453e9cb2d 100644 --- a/src/com/goide/stubs/types/GoVarSpecStubElementType.java +++ b/src/com/goide/stubs/types/GoVarSpecStubElementType.java @@ -59,7 +59,7 @@ public GoVarSpecStub createStub(@NotNull GoVarSpec psi, StubElement parentStub) } @Override - public boolean shouldCreateStub(@NotNull ASTNode node) { + public boolean shouldCreateStub(ASTNode node) { return super.shouldCreateStub(node) && node.getElementType() == GoTypes.VAR_SPEC && PsiTreeUtil.getParentOfType(node.getPsi(), GoFunctionOrMethodDeclaration.class) == null; diff --git a/src/com/goide/tree/ExportabilitySorter.java b/src/com/goide/tree/ExportabilitySorter.java index 65d8fc17df..4460bcfe62 100644 --- a/src/com/goide/tree/ExportabilitySorter.java +++ b/src/com/goide/tree/ExportabilitySorter.java @@ -21,7 +21,6 @@ import com.intellij.ide.util.treeView.smartTree.Sorter; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.util.Comparator; @@ -30,7 +29,7 @@ public class ExportabilitySorter implements Sorter { public static final Sorter INSTANCE = new ExportabilitySorter(); - @Nullable private static final ActionPresentation PRESENTATION = new ActionPresentation() { + private static final ActionPresentation PRESENTATION = new ActionPresentation() { @Override @NotNull public String getText() { diff --git a/src/com/goide/util/GoExecutor.java b/src/com/goide/util/GoExecutor.java index 34c3105bae..6e380bcbfb 100644 --- a/src/com/goide/util/GoExecutor.java +++ b/src/com/goide/util/GoExecutor.java @@ -75,15 +75,14 @@ public class GoExecutor { private boolean myPtyDisabled = false; @Nullable private String myExePath = null; @Nullable private String myPresentableName; - @Nullable private OSProcessHandler myProcessHandler; - @NotNull private Collection myProcessListeners = ContainerUtil.newArrayList(); + private OSProcessHandler myProcessHandler; + private Collection myProcessListeners = ContainerUtil.newArrayList(); private GoExecutor(@NotNull Project project, @Nullable Module module) { myProject = project; myModule = module; } - @NotNull public static GoExecutor in(@NotNull Project project, @Nullable Module module) { return module != null ? in(module) : in(project); } @@ -141,7 +140,6 @@ public GoExecutor withEnvPath(@Nullable String envPath) { return this; } - @NotNull public GoExecutor withProcessListener(@NotNull ProcessListener listener) { myProcessListeners.add(listener); return this; @@ -295,7 +293,7 @@ public ProcessHandler getProcessHandler() { return myProcessHandler; } - private void showNotification(@NotNull final String message, @NotNull final NotificationType type) { + private void showNotification(@NotNull final String message, final NotificationType type) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { diff --git a/src/com/goide/util/GoHistoryProcessListener.java b/src/com/goide/util/GoHistoryProcessListener.java index 4f04b072b8..432ed37a0a 100644 --- a/src/com/goide/util/GoHistoryProcessListener.java +++ b/src/com/goide/util/GoHistoryProcessListener.java @@ -21,7 +21,6 @@ import com.intellij.execution.process.ProcessHandler; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.Pair; -import org.jetbrains.annotations.NotNull; import java.util.concurrent.ConcurrentLinkedQueue; @@ -33,7 +32,7 @@ public void onTextAvailable(ProcessEvent event, Key outputType) { myHistory.add(Pair.create(event, outputType)); } - public void apply(@NotNull ProcessHandler listener) { + public void apply(ProcessHandler listener) { for (Pair pair : myHistory) { listener.notifyTextAvailable(pair.getFirst().getText(), pair.getSecond()); } diff --git a/src/com/goide/util/GoStringLiteralEscaper.java b/src/com/goide/util/GoStringLiteralEscaper.java index 53d42877d1..b3480b1e0b 100644 --- a/src/com/goide/util/GoStringLiteralEscaper.java +++ b/src/com/goide/util/GoStringLiteralEscaper.java @@ -135,7 +135,7 @@ public static void escapeString(@NotNull String chars, @NotNull StringBuilder ou } } - private boolean parseStringCharacters(@NotNull String chars, @NotNull StringBuilder outChars) { + private boolean parseStringCharacters(String chars, StringBuilder outChars) { outSourceOffsets = new int[chars.length() + 1]; outSourceOffsets[chars.length()] = -1; diff --git a/src/com/goide/util/GoUtil.java b/src/com/goide/util/GoUtil.java index 0f1908f62c..b671c735a2 100644 --- a/src/com/goide/util/GoUtil.java +++ b/src/com/goide/util/GoUtil.java @@ -54,13 +54,13 @@ public class GoUtil { public static final String PLUGIN_VERSION = getPlugin().getVersion(); public static final Function RETRIEVE_FILE_PATH_FUNCTION = new Function() { @Override - public String fun(@NotNull VirtualFile file) { + public String fun(VirtualFile file) { return file.getPath(); } }; public static final Function RETRIEVE_FILE_PARENT_FUNCTION = new Function() { @Override - public VirtualFile fun(@NotNull VirtualFile file) { + public VirtualFile fun(VirtualFile file) { return file.getParent(); } }; @@ -160,7 +160,6 @@ public static GlobalSearchScope moduleScopeWithoutLibraries(@NotNull Module modu return GlobalSearchScope.moduleWithDependenciesScope(module).uniteWith(module.getModuleContentWithDependenciesScope()); } - @Nullable public static IdeaPluginDescriptor getPlugin() { return PluginManager.getPlugin(PluginId.getId(PLUGIN_ID)); }