mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove incorrect @Nullable from getIcon() to avoid multiple "returning not null from nullable method" false positives
GitOrigin-RevId: f6db4092c037f563b2b19e909fed325e46af4ebe
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9f15f6251f
commit
306d067698
@@ -20,7 +20,6 @@ import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -59,7 +58,6 @@ public class RegExpFileType extends LanguageFileType {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Icon getIcon() {
|
||||
return getLanguage() == RegExpLanguage.INSTANCE ? AllIcons.FileTypes.Regexp : null;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ public final class SvgFileType extends XmlLikeFileType implements UIBasedFileTyp
|
||||
return "svg";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return ImagesIcons.ImagesFileType;
|
||||
|
||||
@@ -54,7 +54,7 @@ public final class SPIFileType extends LanguageFileType implements FileTypeIdent
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Icon getIcon() {
|
||||
public Icon getIcon() {
|
||||
return AllIcons.FileTypes.Text;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.intellij.testFramework.HeavyPlatformTestCase;
|
||||
import com.intellij.testFramework.LightPlatformTestCase;
|
||||
import com.intellij.util.LocalTimeCounter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Objects;
|
||||
@@ -43,7 +42,6 @@ public class PsiDocumentManager2Test extends LightPlatformTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public final class ManifestFileType extends LanguageFileType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Icon getIcon() {
|
||||
public Icon getIcon() {
|
||||
return AllIcons.FileTypes.Manifest;
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import com.intellij.icons.AllIcons;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -45,7 +44,6 @@ public class JsonFileType extends LanguageFileType{
|
||||
return DEFAULT_EXTENSION;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
// TODO: add JSON icon instead
|
||||
|
||||
-1
@@ -338,7 +338,6 @@ public class TemplateDataElementType extends IFileElementType implements ITempla
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public interface FileType extends Scheme {
|
||||
/**
|
||||
* Returns the icon used for showing files of the type, or {@code null} if no icon should be shown.
|
||||
*/
|
||||
@Nullable Icon getIcon();
|
||||
Icon getIcon();
|
||||
|
||||
/**
|
||||
* Returns {@code true} if files of the specified type contain binary data, {@code false} if the file is plain text.
|
||||
|
||||
@@ -30,7 +30,7 @@ public final class PlainTextFileType extends LanguageFileType implements PlainTe
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Icon getIcon() {
|
||||
public Icon getIcon() {
|
||||
return AllIcons.FileTypes.Text;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.intellij.openapi.fileTypes.PlainTextLanguage;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -49,7 +48,6 @@ public class ScratchFileType extends LanguageFileType {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return PlainTextFileType.INSTANCE.getIcon();
|
||||
|
||||
@@ -237,7 +237,7 @@ public class GotoFileModel extends FilteringGotoByModel<FileTypeRef> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Icon getIcon() {
|
||||
public Icon getIcon() {
|
||||
return PlatformIcons.FOLDER_ICON;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -212,7 +212,7 @@ public class OSAssociateFileTypesUtil {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Icon getIcon() {
|
||||
public Icon getIcon() {
|
||||
return myOriginalType.getIcon();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ final class FileTypeKeyDescriptor implements KeyDescriptor<FileType> {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public final class DetectedByContentFileType implements FileType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Icon getIcon() {
|
||||
public Icon getIcon() {
|
||||
return AllIcons.FileTypes.Text;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -1063,7 +1063,7 @@ public class FileTypesTest extends HeavyPlatformTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Icon getIcon() {
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1145,7 +1145,7 @@ public class FileTypesTest extends HeavyPlatformTestCase {
|
||||
@Override public @NotNull String getDisplayName() { return getClass().getName(); }
|
||||
@Override public @NotNull String getDescription() { return getDisplayName(); }
|
||||
@Override public @NotNull String getDefaultExtension() { return "hs"; }
|
||||
@Override public @Nullable Icon getIcon() { return null; }
|
||||
@Override public Icon getIcon() { return null; }
|
||||
@Override public boolean isBinary() { return false; }
|
||||
}
|
||||
|
||||
@@ -1250,7 +1250,7 @@ public class FileTypesTest extends HeavyPlatformTestCase {
|
||||
@Override public @NotNull String getName() { return NAME; }
|
||||
@Override public @NotNull String getDescription() { return ""; }
|
||||
@Override public @NotNull String getDefaultExtension() { return EXTENSION; }
|
||||
@Override public @Nullable Icon getIcon() { return null; }
|
||||
@Override public Icon getIcon() { return null; }
|
||||
@Override public boolean isBinary() { return false; }
|
||||
}
|
||||
|
||||
@@ -1262,7 +1262,7 @@ public class FileTypesTest extends HeavyPlatformTestCase {
|
||||
@Override public @NotNull String getName() { return NAME; }
|
||||
@Override public @NotNull String getDescription() { return ""; }
|
||||
@Override public @NotNull String getDefaultExtension() { return "hs"; }
|
||||
@Override public @Nullable Icon getIcon() { return null; }
|
||||
@Override public Icon getIcon() { return null; }
|
||||
@Override public boolean isBinary() { return false; }
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1002,7 +1002,7 @@ public class FileEncodingTest extends HeavyPlatformTestCase implements TestDialo
|
||||
@Override public @NotNull String getName() { return "my"; }
|
||||
@Override public @NotNull String getDescription() { return getName(); }
|
||||
@Override public @NotNull String getDefaultExtension() { return "my"; }
|
||||
@Override public @Nullable Icon getIcon() { return null; }
|
||||
@Override public Icon getIcon() { return null; }
|
||||
|
||||
@Override
|
||||
public Charset extractCharsetFromFileContent(@Nullable Project project, @Nullable VirtualFile file, @NotNull CharSequence content) {
|
||||
@@ -1109,7 +1109,7 @@ public class FileEncodingTest extends HeavyPlatformTestCase implements TestDialo
|
||||
@Override public @NotNull String getName() { return "Test"; }
|
||||
@Override public @NotNull String getDescription() { return "Test"; }
|
||||
@Override public @NotNull String getDefaultExtension() { return ext; }
|
||||
@Override public @Nullable Icon getIcon() { return null; }
|
||||
@Override public Icon getIcon() { return null; }
|
||||
@Override public String getCharset(@NotNull VirtualFile file, byte @NotNull [] content) { return StandardCharsets.ISO_8859_1.name(); }
|
||||
}
|
||||
MyForcedFileType fileType = new MyForcedFileType();
|
||||
|
||||
@@ -26,7 +26,6 @@ package com.intellij.openapi.vcs.changes.ignore.lang;
|
||||
|
||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -84,7 +83,6 @@ public class IgnoreFileType extends LanguageFileType {
|
||||
*
|
||||
* @return The icon instance, or null if no icon should be shown.
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return getIgnoreLanguage().getIcon();
|
||||
|
||||
@@ -51,7 +51,6 @@ public class PatchFileType implements FileType {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Icon getIcon() {
|
||||
return AllIcons.Vcs.Patch_file;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.idea.eclipse.EclipseBundle;
|
||||
import org.jetbrains.idea.eclipse.EclipseXml;
|
||||
|
||||
@@ -47,7 +46,6 @@ public class EclipseFileType implements FileType {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Icon getIcon() {
|
||||
return AllIcons.Providers.Eclipse;
|
||||
}
|
||||
|
||||
-1
@@ -35,7 +35,6 @@ public class LombokConfigFileType extends LanguageFileType {
|
||||
return "config";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return LombokIcons.Config;
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
import org.intellij.plugins.markdown.MarkdownBundle;
|
||||
import org.intellij.plugins.markdown.MarkdownIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -34,7 +33,6 @@ public final class MarkdownFileType extends LanguageFileType {
|
||||
return "md";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return MarkdownIcons.MarkdownPlugin;
|
||||
|
||||
@@ -38,7 +38,7 @@ public final class JqlFileType extends LanguageFileType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Icon getIcon() {
|
||||
public Icon getIcon() {
|
||||
return TasksCoreIcons.Jira;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public final class YouTrackFileType extends LanguageFileType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Icon getIcon() {
|
||||
public Icon getIcon() {
|
||||
return TasksCoreIcons.Youtrack;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ public final class TextMateFileType extends LanguageFileType implements FileType
|
||||
return "";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return AllIcons.FileTypes.Text;
|
||||
|
||||
@@ -35,7 +35,6 @@ public final class YAMLFileType extends LanguageFileType {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Icon getIcon() {
|
||||
return AllIcons.FileTypes.Yaml;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ public class PythonFileType extends LanguageFileType {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Icon getIcon() {
|
||||
return PythonPsiApiIcons.PythonFile;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
import icons.RestIcons;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -41,7 +40,6 @@ public final class RestFileType extends LanguageFileType {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Icon getIcon() {
|
||||
return RestIcons.Rst;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ package com.jetbrains.commandInterface.commandLine;
|
||||
|
||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -54,7 +53,6 @@ public final class CommandLineFileType extends LanguageFileType {
|
||||
return EXTENSION;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.intellij.spellchecker.util.SpellCheckerBundle;
|
||||
import icons.SpellcheckerIcons;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -42,7 +41,6 @@ public class DictionaryFileType implements FileType {
|
||||
return "dic";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return SpellcheckerIcons.Dictionary;
|
||||
|
||||
Reference in New Issue
Block a user