langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java
changeset 41033 49af2ecba616
parent 40513 39b67170b045
child 42261 bb52b5514ad5
equal deleted inserted replaced
41032:32be25e34c38 41033:49af2ecba616
    76 import com.sun.tools.javac.util.List;
    76 import com.sun.tools.javac.util.List;
    77 import com.sun.tools.javac.util.ListBuffer;
    77 import com.sun.tools.javac.util.ListBuffer;
    78 import com.sun.tools.javac.util.JDK9Wrappers.Configuration;
    78 import com.sun.tools.javac.util.JDK9Wrappers.Configuration;
    79 import com.sun.tools.javac.util.JDK9Wrappers.Layer;
    79 import com.sun.tools.javac.util.JDK9Wrappers.Layer;
    80 import com.sun.tools.javac.util.JDK9Wrappers.ModuleFinder;
    80 import com.sun.tools.javac.util.JDK9Wrappers.ModuleFinder;
       
    81 import com.sun.tools.javac.util.JDK9Wrappers.Module;
    81 import com.sun.tools.javac.util.JDK9Wrappers.ServiceLoaderHelper;
    82 import com.sun.tools.javac.util.JDK9Wrappers.ServiceLoaderHelper;
    82 
    83 
    83 import static java.nio.file.FileVisitOption.FOLLOW_LINKS;
    84 import static java.nio.file.FileVisitOption.FOLLOW_LINKS;
    84 
    85 
    85 import static javax.tools.StandardLocation.*;
    86 import static javax.tools.StandardLocation.*;
   955 
   956 
   956     @Override @DefinedBy(Api.COMPILER)
   957     @Override @DefinedBy(Api.COMPILER)
   957     public <S> ServiceLoader<S> getServiceLoader(Location location, Class<S> service) throws IOException {
   958     public <S> ServiceLoader<S> getServiceLoader(Location location, Class<S> service) throws IOException {
   958         nullCheck(location);
   959         nullCheck(location);
   959         nullCheck(service);
   960         nullCheck(service);
       
   961         Module.getModule(getClass()).addUses(service);
   960         if (location.isModuleLocation()) {
   962         if (location.isModuleLocation()) {
   961             Collection<Path> paths = locations.getLocation(location);
   963             Collection<Path> paths = locations.getLocation(location);
   962             ModuleFinder finder = ModuleFinder.of(paths.toArray(new Path[paths.size()]));
   964             ModuleFinder finder = ModuleFinder.of(paths.toArray(new Path[paths.size()]));
   963             Layer bootLayer = Layer.boot();
   965             Layer bootLayer = Layer.boot();
   964             Configuration cf = bootLayer.configuration().resolveRequiresAndUses(ModuleFinder.of(), finder, Collections.emptySet());
   966             Configuration cf = bootLayer.configuration().resolveRequiresAndUses(ModuleFinder.of(), finder, Collections.emptySet());