Skip to content

Commit

Permalink
Revert "@NotNull/@nullable"
Browse files Browse the repository at this point in the history
This reverts commit 5b2237d.
  • Loading branch information
zolotov committed Nov 10, 2015
1 parent 34a2007 commit bdc02ba
Show file tree
Hide file tree
Showing 114 changed files with 204 additions and 301 deletions.
13 changes: 4 additions & 9 deletions src/com/goide/GoAnnotator.java
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions src/com/goide/GoModuleBuilder.java
Expand Up @@ -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<Pair<String, String>> getSourcePaths() {
return ContainerUtil.emptyList();
Expand Down
2 changes: 1 addition & 1 deletion src/com/goide/actions/GoCreateFileAction.java
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/com/goide/actions/fmt/GoDownloadableFileAction.java
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/com/goide/actions/fmt/GoExternalToolsAction.java
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/com/goide/actions/fmt/GoTypeFileAction.java
Expand Up @@ -29,7 +29,7 @@ public GoTypeFileAction() {
}

@Override
protected boolean isAvailableOnFile(@NotNull VirtualFile file) {
protected boolean isAvailableOnFile(VirtualFile file) {
return super.isAvailableOnFile(file) || file.isDirectory();
}

Expand Down
1 change: 0 additions & 1 deletion src/com/goide/appengine/YamlFilesModificationTracker.java
Expand Up @@ -79,7 +79,6 @@ public static Collection<VirtualFile> getYamlFiles(@NotNull final Project projec
@Override
public Result<Collection<VirtualFile>> compute() {
Collection<VirtualFile> yamlFiles = ApplicationManager.getApplication().runReadAction(new Computable<Collection<VirtualFile>>() {
@NotNull
@Override
public Collection<VirtualFile> compute() {
GlobalSearchScope scope = module != null ? GoUtil.moduleScopeWithoutLibraries(module) : GlobalSearchScope.projectScope(project);
Expand Down
Expand Up @@ -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);
Expand Down
Expand Up @@ -79,7 +79,7 @@ protected void disposeEditor() {
private void initConfigFileField(@NotNull Project project) {
GoRunUtil.installFileChooser(project, myConfigFileField, false, false, new Condition<VirtualFile>() {
@Override
public boolean value(@NotNull VirtualFile file) {
public boolean value(VirtualFile file) {
return "yaml".equals(file.getExtension());
}
});
Expand Down
1 change: 0 additions & 1 deletion src/com/goide/appengine/run/GoAppEngineRunningState.java
Expand Up @@ -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");
Expand Down
10 changes: 4 additions & 6 deletions src/com/goide/codeInsight/imports/GoAutoImportConfigurable.java
Expand Up @@ -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;
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -130,7 +129,6 @@ public Runnable enableSearch(String option) {
return null;
}

@NotNull
@Nls
@Override
public String getDisplayName() {
Expand Down
3 changes: 1 addition & 2 deletions src/com/goide/codeInsight/imports/GoCodeInsightSettings.java
Expand Up @@ -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(
Expand All @@ -41,7 +40,7 @@ public GoCodeInsightSettings getState() {
}

@Override
public void loadState(@NotNull GoCodeInsightSettings state) {
public void loadState(GoCodeInsightSettings state) {
XmlSerializerUtil.copyBean(state, this);
}

Expand Down
Expand Up @@ -36,7 +36,7 @@

public class GoExcludePathLookupActionProvider implements LookupActionProvider {
@Override
public void fillActions(@NotNull LookupElement element, Lookup lookup, @NotNull Consumer<LookupElementAction> consumer) {
public void fillActions(LookupElement element, Lookup lookup, Consumer<LookupElementAction> consumer) {
PsiElement psiElement = element.getPsiElement();
PsiFile file = psiElement != null ? psiElement.getContainingFile() : null;
String importPath = file instanceof GoFile ? ((GoFile)file).getImportPath() : null;
Expand All @@ -49,8 +49,7 @@ public void fillActions(@NotNull LookupElement element, Lookup lookup, @NotNull
}
}

@NotNull
private static List<String> getPaths(@NotNull String importPath) {
private static List<String> getPaths(String importPath) {
List<String> result = ContainerUtil.newArrayList(importPath);
int i;
while ((i = importPath.lastIndexOf('/')) > 0) {
Expand Down
3 changes: 1 addition & 2 deletions src/com/goide/codeInsight/imports/GoImportOptimizer.java
Expand Up @@ -112,8 +112,7 @@ public static Set<PsiElement> findRedundantImportIdentifiers(@NotNull MultiMap<S
return importIdentifiersToDelete;
}

@NotNull
public static MultiMap<String, GoImportSpec> filterUnusedImports(@NotNull PsiFile file,
public static MultiMap<String, GoImportSpec> filterUnusedImports(@NotNull PsiFile file,
@NotNull MultiMap<String, GoImportSpec> importMap) {
final MultiMap<String, GoImportSpec> result = MultiMap.create();
result.putAllValues(importMap);
Expand Down
1 change: 0 additions & 1 deletion src/com/goide/configuration/GoBuildTargetConfigurable.java
Expand Up @@ -192,7 +192,6 @@ public void disposeUIResources() {
UIUtil.dispose(myCustomFlagsField);
}

@NotNull
@Nls
@Override
public String getDisplayName() {
Expand Down
3 changes: 1 addition & 2 deletions src/com/goide/configuration/GoConfigurableProvider.java
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/com/goide/configuration/GoLibrariesConfigurable.java
Expand Up @@ -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());
Expand Down Expand Up @@ -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));
Expand Down
11 changes: 5 additions & 6 deletions src/com/goide/configuration/GoLibrariesConfigurableProvider.java
Expand Up @@ -111,9 +111,8 @@ protected List<UnnamedConfigurable> createConfigurables() {
String[] urlsFromEnv = ContainerUtil.map2Array(ContainerUtil.mapNotNull(GoSdkUtil.getGoPathsRootsFromEnvironment(),
new GoSdkUtil.RetrieveSubDirectoryOrSelfFunction("src")),
String.class, new Function<VirtualFile, String>() {
@NotNull
@Override
public String fun(@NotNull VirtualFile file) {
public String fun(VirtualFile file) {
return file.getUrl();
}
});
Expand Down Expand Up @@ -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<HideableDecorator> myHideableDecorators;
private final Spacer mySpacer;
private final Collection<HideableDecorator> myHideableDecorators;

public MyHideableDecoratorListener(@NotNull GridLayoutManager layoutManager,
@NotNull JPanel hideablePanel,
Expand Down
2 changes: 1 addition & 1 deletion src/com/goide/configuration/GoModuleEditorsProvider.java
Expand Up @@ -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);
}

Expand Down
7 changes: 3 additions & 4 deletions src/com/goide/configuration/GoSdkConfigurable.java
Expand Up @@ -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;
Expand Down Expand Up @@ -150,7 +150,6 @@ public Runnable enableSearch(String option) {
return null;
}

@NotNull
@Nls
@Override
public String getDisplayName() {
Expand Down
1 change: 0 additions & 1 deletion src/com/goide/editor/GoParameterInfoHandler.java
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/com/goide/editor/GoWordSelectioner.java
Expand Up @@ -34,7 +34,7 @@ public boolean canSelect(@NotNull PsiElement e) {
}

@Override
public List<TextRange> select(@NotNull PsiElement e, @NotNull CharSequence editorText, int cursorOffset, @NotNull Editor editor) {
public List<TextRange> select(@NotNull PsiElement e, CharSequence editorText, int cursorOffset, Editor editor) {
PsiElement parent = e.getParent();
List<TextRange> result = super.select(e, editorText, cursorOffset, editor);
if (parent instanceof GoImportString || parent instanceof GoStringLiteral) {
Expand Down
3 changes: 1 addition & 2 deletions src/com/goide/editor/surround/GoSurroundDescriptor.java
Expand Up @@ -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");
Expand All @@ -60,7 +60,6 @@ public boolean isExclusive() {
}

public static class GoParenthesisSurrounder implements Surrounder {
@NotNull
@Override
public String getTemplateDescription() {
return "(expression)";
Expand Down
4 changes: 2 additions & 2 deletions src/com/goide/formatter/settings/GoCodeStyleConfigurable.java
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/com/goide/go/GoGotoContributorBase.java
Expand Up @@ -32,7 +32,7 @@
import org.jetbrains.annotations.Nullable;

public class GoGotoContributorBase<T extends GoNamedElement> implements GotoClassContributor, ChooseByNameContributorEx {
@NotNull protected final StubIndexKey<String, T>[] myIndexKeys;
protected final StubIndexKey<String, T>[] myIndexKeys;
@NotNull private final Class<T> myClazz;

public GoGotoContributorBase(@NotNull Class<T> clazz, @NotNull StubIndexKey<String, T>... key) {
Expand Down
2 changes: 1 addition & 1 deletion src/com/goide/inspections/GoDeleteQuickFix.java
Expand Up @@ -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);
}

Expand Down
Expand Up @@ -62,7 +62,6 @@ protected static void checkParameters(@NotNull ProblemsHolder holder,
}
}

@NotNull
private static String errorText(@NotNull String name) {
return "Duplicate argument " + "'" + name + "'";
}
Expand Down
Expand Up @@ -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<GoFunctionDeclaration>() {
@Override
public boolean value(@NotNull GoFunctionDeclaration declaration) {
public boolean value(GoFunctionDeclaration declaration) {
return Comparing.equal(declaration.getContainingFile(), o.getContainingFile());
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/com/goide/inspections/GoDuplicateMethodInspection.java
Expand Up @@ -52,7 +52,7 @@ protected void checkFile(@NotNull GoFile file, @NotNull ProblemsHolder problemsH
Collection<GoMethodDeclaration> declarations = GoMethodIndex.find(packageName + "." + typeText, project, scope);
declarations = ContainerUtil.filter(declarations, new Condition<GoMethodDeclaration>() {
@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());
}
});
Expand Down

0 comments on commit bdc02ba

Please sign in to comment.