Skip to content

Commit c34c326

Browse files
authored
[CQ] remove stale installation failure analytics (#8234)
As per a conversation w/ @helin24, the `eventName` string is likely an artifact from when JXBrowser was being evaluated but is unused now. We agreed to remove it and add back when analytics are in place (and is deemed useful). ![image](https://github.com/user-attachments/assets/4b45f73a-fc75-413f-9025-045cc571a3c8) I also snuck in some null-awareness. There's an assert that ensures `fileName` entries are not null allowing us to update some method signatures making a few asserts redundant. --- - [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 f42a6c3 commit c34c326

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,6 @@ private void setStatusFailed(@NotNull InstallationFailedReason reason) {
169169
}
170170

171171
private void setStatusFailed(@NotNull InstallationFailedReason reason, @Nullable Long time) {
172-
final StringBuilder eventName = new StringBuilder();
173-
eventName.append("installationFailed-");
174-
eventName.append(reason.failureType);
175-
if (reason.detail != null) {
176-
eventName.append("-");
177-
eventName.append(reason.detail);
178-
}
179-
180172
latestFailureReason = reason;
181173
status.set(JxBrowserStatus.INSTALLATION_FAILED);
182174
installation.complete(JxBrowserStatus.INSTALLATION_FAILED);
@@ -275,14 +267,13 @@ public void setUp(@NotNull String projectName) {
275267
downloadJxBrowser(fileNames);
276268
}
277269

278-
protected void downloadJxBrowser(@NotNull String[] fileNames) {
270+
protected void downloadJxBrowser(@NotNull String @NotNull [] fileNames) {
279271
// The FileDownloader API is used by other plugins - e.g.
280272
// https://github.com/JetBrains/intellij-community/blob/b09f8151e0d189d70363266c3bb6edb5f6bfeca4/plugins/markdown/src/org/intellij/plugins/markdown/ui/preview/javafx/JavaFXInstallator.java#L48
281273
final List<FileDownloader> fileDownloaders = new ArrayList<>();
282274
final DownloadableFileService service = DownloadableFileService.getInstance();
283275
assert service != null;
284276
for (String fileName : fileNames) {
285-
assert fileName != null;
286277
final DownloadableFileDescription
287278
description = service.createFileDescription(jxBrowserUtils.getDistributionLink(fileName), fileName);
288279
fileDownloaders.add(service.createDownloader(Collections.singletonList(description), fileName));
@@ -340,14 +331,13 @@ public void run(@NotNull ProgressIndicator indicator) {
340331
}
341332
}
342333

343-
private void loadClasses(@NotNull String[] fileNames) {
334+
private void loadClasses(@NotNull String @NotNull [] fileNames) {
344335
final List<Path> paths = new ArrayList<>();
345336
final ClassLoader current = Thread.currentThread().getContextClassLoader();
346337
try {
347338
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
348339
try {
349340
for (String fileName : fileNames) {
350-
assert fileName != null;
351341
paths.add(Paths.get(getFilePath(fileName)));
352342
}
353343
//noinspection ConstantConditions

0 commit comments

Comments
 (0)