Skip to content

[CQ] [unchecked cast]: fix generic bounds #8087

New issue

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

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

Already on GitHub? Sign in to your account

Merged
Merged
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
11 changes: 4 additions & 7 deletions flutter-idea/src/io/flutter/FlutterErrorReportSubmitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ public boolean submit(@NotNull IdeaLoggingEvent[] events,
@NotNull Component parentComponent,
@NotNull Consumer<? super SubmittedReportInfo> consumer) {
if (events.length == 0) {
// Don't remove the cast until a later version of Android Studio.
fail(((Consumer<SubmittedReportInfo>)consumer));
fail(consumer);
return false;
}

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

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

if (file == null) {
// Don't remove the cast until a later version of Android Studio.
fail(((Consumer<SubmittedReportInfo>)consumer));
fail(consumer);
return false;
}

Expand Down Expand Up @@ -218,7 +215,7 @@ private static String getFlutterVersion(final FlutterSdk sdk) {
}
}

private static void fail(@NotNull Consumer<SubmittedReportInfo> consumer) {
private static void fail(@NotNull Consumer<? super SubmittedReportInfo> consumer) {
consumer.consume(new SubmittedReportInfo(
null,
null,
Expand Down