Skip to content

Migrate the FlutterSampleNotificationProvider to the new EditorNotificationProvider API (#7840) #7842

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 1 commit into from
Dec 4, 2024

Conversation

jwren
Copy link
Member

@jwren jwren commented Dec 3, 2024

This is progress on #7830

@jwren jwren force-pushed the FlutterSampleNotificationProvider_7830 branch from 9e618af to d22385f Compare December 3, 2024 20:56
return getSamplesFromDoc(flutterPackagePath, document, filePath);
});

return samples.isEmpty() ? null : new FlutterSampleActionsPanel(samples);
if (samples != null && !samples.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can samples be null here or can you skip this check? (It looks like getSamplesFromDoc at worst returns an empty list?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApplicationManager.getApplication() and runReadAction can actually be null, hence this check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! So maybe this is new Java. I would have expected ApplicationManager.getApplication(). runReadAction to throw an NPE if getApplication returns null, but cool!

}

private List<FlutterSample> getSamplesFromDoc(String flutterPackagePath, Document document, String filePath) {
private List<FlutterSample> getSamplesFromDoc(@NotNull String flutterPackagePath, @NotNull Document document, @NotNull String filePath) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you mark this @NotNull?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@jwren jwren force-pushed the FlutterSampleNotificationProvider_7830 branch from d22385f to 9f87257 Compare December 4, 2024 17:46
@jwren jwren merged commit 1388a17 into flutter:master Dec 4, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants