Skip to content

[CQ] remove redundant warning suppressions #7996

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ private static void fail(@NotNull Consumer<SubmittedReportInfo> consumer) {
}

private static byte[] readFully(InputStream in) throws IOException {
//noinspection resource
final ByteArrayOutputStream out = new ByteArrayOutputStream();
final byte[] temp = new byte[4096];
int count = in.read(temp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
/**
* Action that reloads all running Flutter apps.
*/
@SuppressWarnings("ComponentNotRegistered")
public class ReloadAllFlutterApps extends FlutterAppAction {
public static final String ID = "Flutter.ReloadAllFlutterApps"; //NON-NLS
public static final String TEXT = FlutterBundle.message("app.reload.all.action.text");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
/**
* Action that restarts all running Flutter apps.
*/
@SuppressWarnings("ComponentNotRegistered")
public class RestartAllFlutterApps extends FlutterAppAction {
public static final String ID = "Flutter.RestartAllFlutterApps"; //NON-NLS
public static final String TEXT = FlutterBundle.message("app.restart.all.action.text");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ private String getBasePathForFamily(@NotNull String family, @NotNull FlutterSdk
private LineMarkerInfo<PsiElement> createLineMarker(@Nullable PsiElement element, @NotNull Icon icon) {
if (element == null) return null;
assert element.getTextRange() != null;
//noinspection MissingRecentApi
return new LineMarkerInfo<>(element, element.getTextRange(), icon, null, null,
GutterIconRenderer.Alignment.LEFT, () -> "");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ public void settingsChanged() {
final FlutterSettings settings = FlutterSettings.getInstance();

// Set up JxBrowser files if the embedded inspector option has been turned on and the files aren't already loaded.
//noinspection ConstantConditions
if (getStatus().equals(JxBrowserStatus.NOT_INSTALLED)) {
setUp(projectName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public void projectOpened(@NotNull Project project) {
}
//noinspection ConstantConditions
StartupManager.getInstance(project).runAfterOpened(() -> {
//noinspection ConstantConditions
DumbService.getInstance(project).smartInvokeLater(() -> {
for (ModuleDescriptor module : modules) {
assert module != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.util.Collections;
import java.util.List;

@SuppressWarnings("Duplicates")
public class DartTestLocationProviderZ implements SMTestLocator, DumbAware {
@SuppressWarnings("rawtypes")
private static final List<Location> NONE = Collections.emptyList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ private void checkForDisplaySurvey() {
null
);

//noinspection DialogTitleCapitalization
notification.addAction(new AnAction(SURVEY_ACTION_TEXT) {
@Override
public void actionPerformed(@NotNull AnActionEvent event) {
Expand All @@ -109,7 +108,6 @@ public void actionPerformed(@NotNull AnActionEvent event) {
}
});

//noinspection DialogTitleCapitalization
notification.addAction(new AnAction(SURVEY_DISMISSAL_TEXT) {
@Override
public void actionPerformed(@NotNull AnActionEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* event followed some time later by an 'error' event for that same test. That should
* convert a successful test into a failure. That case is not being handled.
*/
@SuppressWarnings({"Duplicates", "FieldMayBeFinal", "LocalCanBeFinal", "SameReturnValue"})
@SuppressWarnings({"FieldMayBeFinal", "LocalCanBeFinal", "SameReturnValue"})
public class DartTestEventsConverterZ extends OutputToGeneralTestEventsConverter {
private static final Logger LOG = Logger.getInstance(DartTestEventsConverterZ.class);

Expand Down Expand Up @@ -156,7 +156,6 @@ private boolean doProcessServiceMessages(@NotNull final String text) throws Pars
return super.processServiceMessages(text, myCurrentOutputType, myCurrentVisitor);
}

@SuppressWarnings("SimplifiableIfStatement")
private boolean process(JsonObject obj) throws JsonSyntaxException, ParseException {
String type = obj.get(JSON_TYPE).getAsString();
if (TYPE_TEST_START.equals(type)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public void connectionOpened() {

}

@SuppressWarnings("DuplicateBranchesInSwitch")
@Override
public void received(@NotNull final String streamId, @NotNull final Event event) {
switch (event.getKind()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public static void configureFlutterSdk(@NotNull final Module module, @NotNull fi
//final String dartSdkHome = sdkHome + "bin/cache/dart-sdk";
//VfsRootAccess.allowRootAccess(disposable, dartSdkHome);

//noinspection ConstantConditions
//ApplicationManager.getApplication().runWriteAction(() -> {
// Disposer.register(disposable, DartSdkLibUtil.configureDartSdkAndReturnUndoingDisposable(module.getProject(), dartSdkHome));
// Disposer.register(disposable, DartSdkLibUtil.enableDartSdkAndReturnUndoingDisposable(module));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,11 @@ private void doGradleSync(Project flutterProject, Function<Project, Void> callba
Disposer.register(flutterProject, androidProject);

GradleSyncListener listener = new GradleSyncListener() {
@SuppressWarnings("override")
public void syncTaskCreated(@NotNull Project project, @NotNull GradleSyncInvoker.Request request) {}

// TODO(messick) Remove when 3.6 is stable.
public void syncStarted(@NotNull Project project, boolean skipped, boolean sourceGenerationRequested) {}

@SuppressWarnings("override")
public void setupStarted(@NotNull Project project) {}

@Override
Expand Down
1 change: 0 additions & 1 deletion flutter-studio/src/io/flutter/utils/AddToAppUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ public void syncSkipped(@NotNull Project project) {
GradleUtils.checkDartSupport(project);
}

@SuppressWarnings("override")
public void sourceGenerationFinished(@NotNull Project project) {
}
};
Expand Down
2 changes: 0 additions & 2 deletions flutter-studio/src/io/flutter/utils/GradleUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ private static boolean isCoeditTransformedProject(@NotNull Project project) {

// Copied from org.jetbrains.plugins.gradle.execution.GradleRunAnythingProvider.
@NotNull
@SuppressWarnings("DuplicatedCode")
private static Map<ProjectData, MultiMap<String, String>> getTasksMap(Project project) {
Map<ProjectData, MultiMap<String, String>> tasks = new LinkedHashMap<>();
for (GradleProjectSettings setting : GradleSettings.getInstance(project).getLinkedProjectsSettings()) {
Expand Down Expand Up @@ -458,7 +457,6 @@ private String readSettingsFile() {
try {
requireNonNull(pathToModule);
requireNonNull(settingsFile);
@SuppressWarnings({"IOResourceOpenedButNotSafelyClosed", "resource"})
BufferedInputStream str = new BufferedInputStream(settingsFile.getInputStream());
return FileUtil.loadTextAndClose(new InputStreamReader(str, CharsetToolkit.UTF8_CHARSET));
}
Expand Down