< prev index next >

src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java

Print this page
@@ -55,10 +55,11 @@
  
  import jdk.internal.jimage.ImageReader;
  import jdk.internal.jimage.SystemImageReader;
  import jdk.internal.access.JavaNetUriAccess;
  import jdk.internal.access.SharedSecrets;
+ import jdk.internal.misc.PreviewFeatures;
  import jdk.internal.util.StaticProperty;
  import jdk.internal.module.ModuleHashes.HashSupplier;
  
  /**
   * The factory for SystemModules objects and for creating ModuleFinder objects

@@ -198,15 +199,15 @@
              cachedSystemModuleFinder = finder;
              return finder;
  
          }
  
-         // exploded build (do not cache module finder)
+         // exploded build
          Path dir = Path.of(home, "modules");
          if (!Files.isDirectory(dir))
              throw new InternalError("Unable to detect the run-time image");
-         return ModulePath.of(ModuleBootstrap.patcher(), dir);
+         return ModulePath.ofExplodedImage(dir, ModuleBootstrap.patcher(), PreviewFeatures.isEnabled());
      }
  
      /**
       * Parses the {@code module-info.class} of all modules in the runtime image and
       * returns a ModuleFinder to find the modules.
< prev index next >