From bb32225db50e57121cf852e48cfe73c957d2430e Mon Sep 17 00:00:00 2001 From: Tomasz Pasternak <1066003+tpasternak@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:37:17 +0100 Subject: [PATCH] fix: Small codegen libraries were removed from the Project Structure (#7042) Partially related to #6547 The EmptyJarFilter is using a heuristic that is really not robust https://github.com/bazelbuild/intellij/blob/3f81565b4aede217e160adc97a3f3b619bfa0498/java/src/com/google/idea/blaze/java/sync/importer/emptylibrary/EmptyLibraryFilter.java#L42-L50 Co-authored-by: Tomasz Pasternak --- .../java/sync/importer/emptylibrary/EmptyLibraryFilter.java | 2 +- .../java/sync/importer/BlazeJavaWorkspaceImporterTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/java/src/com/google/idea/blaze/java/sync/importer/emptylibrary/EmptyLibraryFilter.java b/java/src/com/google/idea/blaze/java/sync/importer/emptylibrary/EmptyLibraryFilter.java index 3850fbc3721..a9db1e98645 100644 --- a/java/src/com/google/idea/blaze/java/sync/importer/emptylibrary/EmptyLibraryFilter.java +++ b/java/src/com/google/idea/blaze/java/sync/importer/emptylibrary/EmptyLibraryFilter.java @@ -67,7 +67,7 @@ static boolean isEnabled() { return Arrays.stream(EmptyLibraryFilterSettings.EP_NAME.getExtensions()) .findFirst() .map(EmptyLibraryFilterSettings::isEnabled) - .orElse(true); + .orElse(false); } @Override diff --git a/java/tests/unittests/com/google/idea/blaze/java/sync/importer/BlazeJavaWorkspaceImporterTest.java b/java/tests/unittests/com/google/idea/blaze/java/sync/importer/BlazeJavaWorkspaceImporterTest.java index aa0adefa470..d31c2dab3e2 100644 --- a/java/tests/unittests/com/google/idea/blaze/java/sync/importer/BlazeJavaWorkspaceImporterTest.java +++ b/java/tests/unittests/com/google/idea/blaze/java/sync/importer/BlazeJavaWorkspaceImporterTest.java @@ -97,6 +97,8 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import javax.annotation.Nullable; + +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -1085,6 +1087,7 @@ public void testLibraryDependenciesWithJdepsButNoTarget() { } @Test + @Ignore // We disabled empty library exclusion and it is unclear if we will ever reenable it public void testEmptyLibraryExcluded() { ProjectView projectView = ProjectView.builder()