Skip to content

Commit 4e61dc8

Browse files
authored
[CQ] remove redundant warning suppressions (#7996)
Clean up a bunch of unneeded (redundant) warning suppressions.
1 parent 63a2216 commit 4e61dc8

14 files changed

+1
-18
lines changed

flutter-idea/src/io/flutter/FlutterErrorReportSubmitter.java

-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ private static void fail(@NotNull Consumer<SubmittedReportInfo> consumer) {
226226
}
227227

228228
private static byte[] readFully(InputStream in) throws IOException {
229-
//noinspection resource
230229
final ByteArrayOutputStream out = new ByteArrayOutputStream();
231230
final byte[] temp = new byte[4096];
232231
int count = in.read(temp);

flutter-idea/src/io/flutter/actions/ReloadAllFlutterApps.java

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
/**
2222
* Action that reloads all running Flutter apps.
2323
*/
24-
@SuppressWarnings("ComponentNotRegistered")
2524
public class ReloadAllFlutterApps extends FlutterAppAction {
2625
public static final String ID = "Flutter.ReloadAllFlutterApps"; //NON-NLS
2726
public static final String TEXT = FlutterBundle.message("app.reload.all.action.text");

flutter-idea/src/io/flutter/actions/RestartAllFlutterApps.java

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
/**
2020
* Action that restarts all running Flutter apps.
2121
*/
22-
@SuppressWarnings("ComponentNotRegistered")
2322
public class RestartAllFlutterApps extends FlutterAppAction {
2423
public static final String ID = "Flutter.RestartAllFlutterApps"; //NON-NLS
2524
public static final String TEXT = FlutterBundle.message("app.restart.all.action.text");

flutter-idea/src/io/flutter/editor/FlutterIconLineMarkerProvider.java

-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ private String getBasePathForFamily(@NotNull String family, @NotNull FlutterSdk
295295
private LineMarkerInfo<PsiElement> createLineMarker(@Nullable PsiElement element, @NotNull Icon icon) {
296296
if (element == null) return null;
297297
assert element.getTextRange() != null;
298-
//noinspection MissingRecentApi
299298
return new LineMarkerInfo<>(element, element.getTextRange(), icon, null, null,
300299
GutterIconRenderer.Alignment.LEFT, () -> "");
301300
}

flutter-idea/src/io/flutter/jxbrowser/JxBrowserManager.java

-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ public void settingsChanged() {
157157
final FlutterSettings settings = FlutterSettings.getInstance();
158158

159159
// Set up JxBrowser files if the embedded inspector option has been turned on and the files aren't already loaded.
160-
//noinspection ConstantConditions
161160
if (getStatus().equals(JxBrowserStatus.NOT_INSTALLED)) {
162161
setUp(projectName);
163162
}

flutter-idea/src/io/flutter/project/FlutterProjectStructureDetector.java

-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ public void projectOpened(@NotNull Project project) {
111111
}
112112
//noinspection ConstantConditions
113113
StartupManager.getInstance(project).runAfterOpened(() -> {
114-
//noinspection ConstantConditions
115114
DumbService.getInstance(project).smartInvokeLater(() -> {
116115
for (ModuleDescriptor module : modules) {
117116
assert module != null;

flutter-idea/src/io/flutter/run/test/DartTestLocationProviderZ.java

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import java.util.Collections;
3535
import java.util.List;
3636

37-
@SuppressWarnings("Duplicates")
3837
public class DartTestLocationProviderZ implements SMTestLocator, DumbAware {
3938
@SuppressWarnings("rawtypes")
4039
private static final List<Location> NONE = Collections.emptyList();

flutter-idea/src/io/flutter/survey/FlutterSurveyNotifications.java

-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ private void checkForDisplaySurvey() {
9797
null
9898
);
9999

100-
//noinspection DialogTitleCapitalization
101100
notification.addAction(new AnAction(SURVEY_ACTION_TEXT) {
102101
@Override
103102
public void actionPerformed(@NotNull AnActionEvent event) {
@@ -109,7 +108,6 @@ public void actionPerformed(@NotNull AnActionEvent event) {
109108
}
110109
});
111110

112-
//noinspection DialogTitleCapitalization
113111
notification.addAction(new AnAction(SURVEY_DISMISSAL_TEXT) {
114112
@Override
115113
public void actionPerformed(@NotNull AnActionEvent event) {

flutter-idea/src/io/flutter/test/DartTestEventsConverterZ.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* event followed some time later by an 'error' event for that same test. That should
3333
* convert a successful test into a failure. That case is not being handled.
3434
*/
35-
@SuppressWarnings({"Duplicates", "FieldMayBeFinal", "LocalCanBeFinal", "SameReturnValue"})
35+
@SuppressWarnings({"FieldMayBeFinal", "LocalCanBeFinal", "SameReturnValue"})
3636
public class DartTestEventsConverterZ extends OutputToGeneralTestEventsConverter {
3737
private static final Logger LOG = Logger.getInstance(DartTestEventsConverterZ.class);
3838

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

159-
@SuppressWarnings("SimplifiableIfStatement")
160159
private boolean process(JsonObject obj) throws JsonSyntaxException, ParseException {
161160
String type = obj.get(JSON_TYPE).getAsString();
162161
if (TYPE_TEST_START.equals(type)) {

flutter-idea/src/io/flutter/vmService/DartVmServiceListener.java

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public void connectionOpened() {
4040

4141
}
4242

43-
@SuppressWarnings("DuplicateBranchesInSwitch")
4443
@Override
4544
public void received(@NotNull final String streamId, @NotNull final Event event) {
4645
switch (event.getKind()) {

flutter-idea/testSrc/unit/io/flutter/ide/DartTestUtils.java

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public static void configureFlutterSdk(@NotNull final Module module, @NotNull fi
5757
//final String dartSdkHome = sdkHome + "bin/cache/dart-sdk";
5858
//VfsRootAccess.allowRootAccess(disposable, dartSdkHome);
5959

60-
//noinspection ConstantConditions
6160
//ApplicationManager.getApplication().runWriteAction(() -> {
6261
// Disposer.register(disposable, DartSdkLibUtil.configureDartSdkAndReturnUndoingDisposable(module.getProject(), dartSdkHome));
6362
// Disposer.register(disposable, DartSdkLibUtil.enableDartSdkAndReturnUndoingDisposable(module));

flutter-studio/src/io/flutter/android/AndroidModuleLibraryManager.java

-2
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,11 @@ private void doGradleSync(Project flutterProject, Function<Project, Void> callba
218218
Disposer.register(flutterProject, androidProject);
219219

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

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

227-
@SuppressWarnings("override")
228226
public void setupStarted(@NotNull Project project) {}
229227

230228
@Override

flutter-studio/src/io/flutter/utils/AddToAppUtils.java

-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ public void syncSkipped(@NotNull Project project) {
119119
GradleUtils.checkDartSupport(project);
120120
}
121121

122-
@SuppressWarnings("override")
123122
public void sourceGenerationFinished(@NotNull Project project) {
124123
}
125124
};

flutter-studio/src/io/flutter/utils/GradleUtils.java

-2
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ private static boolean isCoeditTransformedProject(@NotNull Project project) {
276276

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

0 commit comments

Comments
 (0)