From 5179035f3da344d231ecf10f798cafcbe2125987 Mon Sep 17 00:00:00 2001 From: Colin Godsey Date: Thu, 30 Mar 2023 11:19:10 -0600 Subject: [PATCH] f --- .../android/projectsystem/BlazeModuleSystem.java | 12 ++++++++---- .../projectsystem/RenderJarClassFileFinder.java | 8 ++++---- .../resources/BlazeLightResourceClassService.java | 11 ++++++----- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/aswb/src/com/google/idea/blaze/android/projectsystem/BlazeModuleSystem.java b/aswb/src/com/google/idea/blaze/android/projectsystem/BlazeModuleSystem.java index 4a9a434fa1f..e8325a68572 100644 --- a/aswb/src/com/google/idea/blaze/android/projectsystem/BlazeModuleSystem.java +++ b/aswb/src/com/google/idea/blaze/android/projectsystem/BlazeModuleSystem.java @@ -15,8 +15,6 @@ */ package com.google.idea.blaze.android.projectsystem; -import static com.google.common.collect.ImmutableList.toImmutableList; - import com.android.ide.common.util.PathString; import com.android.projectmodel.ExternalAndroidLibrary; import com.android.projectmodel.ExternalLibraryImpl; @@ -44,14 +42,20 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; +import org.jetbrains.annotations.Nullable; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.UncheckedIOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.Collection; import java.util.Collections; import java.util.stream.Stream; -import org.jetbrains.annotations.Nullable; + +import static com.google.common.collect.ImmutableList.toImmutableList; /** Blaze implementation of {@link AndroidModuleSystem}. */ public class BlazeModuleSystem extends BlazeModuleSystemBase { diff --git a/aswb/src/com/google/idea/blaze/android/projectsystem/RenderJarClassFileFinder.java b/aswb/src/com/google/idea/blaze/android/projectsystem/RenderJarClassFileFinder.java index e67ae7e6f80..7d337b6d978 100644 --- a/aswb/src/com/google/idea/blaze/android/projectsystem/RenderJarClassFileFinder.java +++ b/aswb/src/com/google/idea/blaze/android/projectsystem/RenderJarClassFileFinder.java @@ -15,8 +15,6 @@ */ package com.google.idea.blaze.android.projectsystem; -import static java.util.stream.Collectors.joining; - import com.android.tools.idea.projectsystem.ClassFileFinder; import com.android.tools.idea.projectsystem.ClassFileFinderUtil; import com.google.common.annotations.VisibleForTesting; @@ -44,6 +42,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.JarFileSystem; import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.Nullable; import java.io.File; import java.util.HashMap; @@ -51,7 +50,7 @@ import java.util.Map; import java.util.regex.Pattern; -import org.jetbrains.annotations.Nullable; +import static java.util.stream.Collectors.joining; /** * A {@link ClassFileFinder} that uses deploy JAR like artifacts (called render jar henceforth) for @@ -69,6 +68,8 @@ * *

NOTE: Blaze targets that constitutes the resource module will be called "resource target(s)" * in comments below. + * + * TODO: The role of this class has expanded beyond just render jar resolution. Should rename it. */ public class RenderJarClassFileFinder implements ClassFileFinder { /** Experiment to control whether class file finding from render jars should be enabled. */ @@ -320,7 +321,6 @@ private ModuleCache(Module module) { @Nullable private VirtualFile searchForFQCNInModule(String fqcn) { - log.warn(String.format("finding class %s in module %s", fqcn, module.getName())); String pkg = null; int pkgIdx = fqcn.lastIndexOf('.'); if (pkgIdx != -1) { diff --git a/aswb/src/com/google/idea/blaze/android/resources/BlazeLightResourceClassService.java b/aswb/src/com/google/idea/blaze/android/resources/BlazeLightResourceClassService.java index 68335846cd4..c01b98a0d0c 100644 --- a/aswb/src/com/google/idea/blaze/android/resources/BlazeLightResourceClassService.java +++ b/aswb/src/com/google/idea/blaze/android/resources/BlazeLightResourceClassService.java @@ -15,8 +15,6 @@ */ package com.google.idea.blaze.android.resources; -import static com.google.common.collect.ImmutableSet.toImmutableSet; - import com.android.tools.idea.projectsystem.LightResourceClassService; import com.android.tools.idea.res.AndroidLightPackage; import com.google.common.annotations.VisibleForTesting; @@ -35,12 +33,15 @@ import com.intellij.psi.PsiManager; import com.intellij.psi.PsiPackage; import com.intellij.psi.search.GlobalSearchScope; +import org.jetbrains.android.facet.AndroidFacet; +import org.jetbrains.annotations.Nullable; + import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Set; -import org.jetbrains.android.facet.AndroidFacet; -import org.jetbrains.annotations.Nullable; + +import static com.google.common.collect.ImmutableSet.toImmutableSet; /** Implementation of {@link LightResourceClassService} set up at Blaze sync time. */ public class BlazeLightResourceClassService implements LightResourceClassService { @@ -54,7 +55,7 @@ public class BlazeLightResourceClassService implements LightResourceClassService // (PsiElementFinderImpl has 'order="first"'). // Put under experiment just in case we find a problem w/ other element finders. private static final BoolExperiment createStubResourcePackages = - new BoolExperiment("create.stub.resource.packages", true); // suspect + new BoolExperiment("create.stub.resource.packages", true); private final Project project;