Repository: apple/pkl
File: pkl-core/src/main/java/org/pkl/core/Analyzer.java (Java)

Code before:
import org.pkl.core.http.HttpClient;
import org.pkl.core.http.HttpClientInitException;
import org.pkl.core.module.ModuleKeyFactory;
import org.pkl.core.module.ProjectDependenciesManager;
import org.pkl.core.packages.PackageLoadError;
import org.pkl.core.packages.PackageResolver;
import org.pkl.core.project.DeclaredDependencies;
import org.pkl.core.runtime.ModuleResolver;
import org.pkl.core.runtime.ResourceManager;
import org.pkl.core.runtime.VmContext;
import org.pkl.core.runtime.VmException;
import org.pkl.core.runtime.VmImportAnalyzer;
import org.pkl.core.runtime.VmUtils;
import org.pkl.core.util.Nullable;

/** Utility library for static analysis of Pkl programs. */
public class Analyzer {
  private final StackFrameTransformer transformer;
  private final boolean color;
  private final SecurityManager securityManager;
  private final @Nullable Path moduleCacheDir;
  private final @Nullable DeclaredDependencies projectDependencies;
  private final ModuleResolver moduleResolver;
  private final HttpClient httpClient;

  public Analyzer(
      StackFrameTransformer transformer,
      boolean color,
      SecurityManager securityManager,
      Collection<ModuleKeyFactory> moduleKeyFactories,
      @Nullable Path moduleCacheDir,
      @Nullable DeclaredDependencies projectDependencies,
      HttpClient httpClient) {
    this.transformer = transformer;
    this.color = color;
    this.securityManager = securityManager;
    this.moduleCacheDir = moduleCacheDir;
    this.projectDependencies = projectDependencies;
    this.moduleResolver = new ModuleResolver(moduleKeyFactories);
    this.httpClient = httpClient;
  }

  /**
   * Builds a graph of imports from the provided source modules.
   *
   * <p>For details, see {@link ImportGraph}.
   */
  public ImportGraph importGraph(URI... sources) {
    var context = createContext();
    try {
      context.enter();

Review comment (suggestion):
```suggestion
  private final @Nullable TraceMode traceMode;
```

Code after:
import org.pkl.core.evaluatorSettings.TraceMode;
import org.pkl.core.http.HttpClient;
import org.pkl.core.http.HttpClientInitException;
import org.pkl.core.module.ModuleKeyFactory;
import org.pkl.core.module.ProjectDependenciesManager;
import org.pkl.core.packages.PackageLoadError;
import org.pkl.core.packages.PackageResolver;
import org.pkl.core.project.DeclaredDependencies;
import org.pkl.core.runtime.ModuleResolver;
import org.pkl.core.runtime.ResourceManager;
import org.pkl.core.runtime.VmContext;
import org.pkl.core.runtime.VmException;
import org.pkl.core.runtime.VmImportAnalyzer;
import org.pkl.core.runtime.VmUtils;
import org.pkl.core.util.Nullable;

/** Utility library for static analysis of Pkl programs. */
public class Analyzer {
  private final StackFrameTransformer transformer;
  private final boolean color;
  private final SecurityManager securityManager;
  private final @Nullable Path moduleCacheDir;
  private final @Nullable DeclaredDependencies projectDependencies;
  private final ModuleResolver moduleResolver;
  private final HttpClient httpClient;
  private final TraceMode traceMode;

  public Analyzer(
      StackFrameTransformer transformer,
      boolean color,
      SecurityManager securityManager,
      Collection<ModuleKeyFactory> moduleKeyFactories,
      @Nullable Path moduleCacheDir,
      @Nullable DeclaredDependencies projectDependencies,
      HttpClient httpClient,
      @Nullable TraceMode traceMode) {
    this.transformer = transformer;
    this.color = color;
    this.securityManager = securityManager;
    this.moduleCacheDir = moduleCacheDir;
    this.projectDependencies = projectDependencies;
    this.moduleResolver = new ModuleResolver(moduleKeyFactories);
    this.httpClient = httpClient;
    this.traceMode = traceMode;
  }

  /**
   * Builds a graph of imports from the provided source modules.
   *
   * <p>For details, see {@link ImportGraph}.
   */