Skip to content

Comments

Add NOT IN ontology filter#1134

Merged
haideriqbal merged 2 commits intodevfrom
add-not-in-ontology-filter
Dec 15, 2025
Merged

Add NOT IN ontology filter#1134
haideriqbal merged 2 commits intodevfrom
add-not-in-ontology-filter

Conversation

@haideriqbal
Copy link
Collaborator

Fixes #1021

}
}

private class ExcludeFilter {

Check notice

Code scanning / CodeQL

Inner class could be static Note

ExcludeFilter should be made static, since the enclosing instance is not used.

Copilot Autofix

AI 3 months ago

The best way to fix this issue is to declare the ExcludeFilter class as a static nested class. Specifically, in OlsSolrQuery.java (lines 181–192), replace the private class ExcludeFilter { ... } declaration with private static class ExcludeFilter { ... }. This ensures that instances of ExcludeFilter do not hold an implicit reference to an instance of the outer OlsSolrQuery class. No changes to methods, imports, or functionality are required, as ExcludeFilter does not access any instance members of the enclosing class.


Suggested changeset 1
backend/src/main/java/uk/ac/ebi/spot/ols/repository/solr/OlsSolrQuery.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/backend/src/main/java/uk/ac/ebi/spot/ols/repository/solr/OlsSolrQuery.java b/backend/src/main/java/uk/ac/ebi/spot/ols/repository/solr/OlsSolrQuery.java
--- a/backend/src/main/java/uk/ac/ebi/spot/ols/repository/solr/OlsSolrQuery.java
+++ b/backend/src/main/java/uk/ac/ebi/spot/ols/repository/solr/OlsSolrQuery.java
@@ -178,7 +178,7 @@
 		}
 	}
 
-	private class ExcludeFilter {
+	private static class ExcludeFilter {
 
 		String propertyName;
 		Collection<String> propertyValues; // all values to exclude ("OR")
EOF
@@ -178,7 +178,7 @@
}
}

private class ExcludeFilter {
private static class ExcludeFilter {

String propertyName;
Collection<String> propertyValues; // all values to exclude ("OR")
Copilot is powered by AI and may make mistakes. Always verify output.
@haideriqbal
Copy link
Collaborator Author

Now we have a scrollable list of ontologies in the filter sorted by descending order... If we select anything from one the filter other one become greyed out.

Screenshot 2025-12-12 at 16 25 00 Screenshot 2025-12-12 at 16 24 49 Screenshot 2025-12-12 at 16 24 42

@haideriqbal haideriqbal merged commit 33a0fac into dev Dec 15, 2025
14 checks passed
@haideriqbal haideriqbal deleted the add-not-in-ontology-filter branch December 15, 2025 10:43
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.

Filter by "NOT in Ontology"

2 participants