Skip to content

Commit dc1de57

Browse files
authored
[CQ] [unchecked cast]: fix generic bounds (#8087)
Fix up the generic wildcard bounds so we can remove these unsafe casts (that are spamming the logs). ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
1 parent 4b19d3b commit dc1de57

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ public boolean submit(@NotNull IdeaLoggingEvent[] events,
5656
@NotNull Component parentComponent,
5757
@NotNull Consumer<? super SubmittedReportInfo> consumer) {
5858
if (events.length == 0) {
59-
// Don't remove the cast until a later version of Android Studio.
60-
fail(((Consumer<SubmittedReportInfo>)consumer));
59+
fail(consumer);
6160
return false;
6261
}
6362

@@ -97,8 +96,7 @@ public boolean submit(@NotNull IdeaLoggingEvent[] events,
9796
final DataContext dataContext = DataManager.getInstance().getDataContext(parentComponent);
9897
final Project project = PROJECT.getData(dataContext);
9998
if (project == null) {
100-
// Don't remove the cast until a later version of Android Studio.
101-
fail(((Consumer<SubmittedReportInfo>)consumer));
99+
fail(consumer);
102100
return false;
103101
}
104102

@@ -187,8 +185,7 @@ public boolean submit(@NotNull IdeaLoggingEvent[] events,
187185
final VirtualFile file = scratchRoot.createScratchFile(project, "bug-report.md", PlainTextLanguage.INSTANCE, text);
188186

189187
if (file == null) {
190-
// Don't remove the cast until a later version of Android Studio.
191-
fail(((Consumer<SubmittedReportInfo>)consumer));
188+
fail(consumer);
192189
return false;
193190
}
194191

@@ -218,7 +215,7 @@ private static String getFlutterVersion(final FlutterSdk sdk) {
218215
}
219216
}
220217

221-
private static void fail(@NotNull Consumer<SubmittedReportInfo> consumer) {
218+
private static void fail(@NotNull Consumer<? super SubmittedReportInfo> consumer) {
222219
consumer.consume(new SubmittedReportInfo(
223220
null,
224221
null,

0 commit comments

Comments
 (0)