Skip to content

Commit d3bde2c

Browse files
authored
[CQ] API: migrate off unstable getInstanceOrNull (#8121)
This method is marked as unstable and slated for possible removal. ![image](https://github.com/user-attachments/assets/feb9c87a-0cc4-44b1-8b40-509b21c48143) That said, this replacement doesn't totally preserve the current semantics. @helin24: is there any reason we don't want to prompt a call to the application manager here? Specifically, we'll now cause this to happen (if `ourInstance` is `null`): ```java (ProgressManager)ApplicationManager.getApplication().getService(ProgressManager.class); ``` See: ##7718 --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](#8098)). </details>
1 parent 1cfc1bb commit d3bde2c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

flutter-idea/src/io/flutter/view/FlutterView.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,8 @@ private void addBrowserInspectorViewContent(FlutterApp app,
198198
});
199199
}));
200200
};
201-
final ProgressManager progressManager = ProgressManager.getInstanceOrNull();
202-
if (progressManager != null) {
203-
progressManager.runProcess(task, new EmptyProgressIndicator());
204-
}
201+
final ProgressManager progressManager = ProgressManager.getInstance();
202+
progressManager.runProcess(task, new EmptyProgressIndicator());
205203

206204
toolWindow.setTitleActions(List.of(new RefreshToolWindowAction(TOOL_WINDOW_ID)));
207205
}

0 commit comments

Comments
 (0)