Skip to content

fix(java): filter out JetBrains releases with features #4970

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions src/plugins/core/java.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ impl JavaPlugin {
let metadata = HTTP_FETCH
.json::<Vec<JavaMetadata>, _>(url)?
.into_iter()
// TODO: remove once we switch over to the new metadata which has these filtered out already
.filter(jetbrains_with_features)
.filter(|m| {
m.file_type
.as_ref()
Expand Down Expand Up @@ -450,6 +452,23 @@ fn arch() -> &'static str {
}
}

// filter JetBrains releases with features debug or fastdebug
fn jetbrains_with_features(m: &JavaMetadata) -> bool {
if m.vendor != "jetbrains" {
return true;
}
// use name to filter since features are not always correct
if m.url.contains("_diz")
|| m.url.contains("jcef")
|| m.url.contains("-fastdebug")
|| m.url.contains("_fd")
|| m.url.contains("_ft")
{
return false;
}
true
}

#[derive(Debug, Serialize, Deserialize, Clone, Default)]
#[serde(default)]
struct JavaMetadata {
Expand Down
Loading