langtools/test/tools/javac/api/TestClientCodeWrapper.java
changeset 42261 bb52b5514ad5
parent 40308 274367a99f98
child 44063 5f0cf4126949
equal deleted inserted replaced
42260:2b4da2bf6660 42261:bb52b5514ad5
    60         JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    60         JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    61         try (StandardJavaFileManager fm = compiler.getStandardFileManager(null, null, null)) {
    61         try (StandardJavaFileManager fm = compiler.getStandardFileManager(null, null, null)) {
    62             defaultFileManager = fm;
    62             defaultFileManager = fm;
    63 
    63 
    64             for (Method m: getMethodsExcept(JavaFileManager.class,
    64             for (Method m: getMethodsExcept(JavaFileManager.class,
    65                         "close", "getJavaFileForInput", "getModuleLocation", "getServiceLoader")) {
    65                         "close", "getJavaFileForInput", "getLocationForModule", "getServiceLoader")) {
    66                 test(m);
    66                 test(m);
    67             }
    67             }
    68 
    68 
    69             for (Method m: getMethodsExcept(FileObject.class, "delete")) {
    69             for (Method m: getMethodsExcept(FileObject.class, "delete")) {
    70                 test(m);
    70                 test(m);
   399             throwUserExceptionIfNeeded(fileManagerMethod, "isSupportedOption");
   399             throwUserExceptionIfNeeded(fileManagerMethod, "isSupportedOption");
   400             return super.isSupportedOption(option);
   400             return super.isSupportedOption(option);
   401         }
   401         }
   402 
   402 
   403         @Override
   403         @Override
   404         public Location getModuleLocation(Location location, String moduleName) throws IOException {
   404         public Location getLocationForModule(Location location, String moduleName) throws IOException {
   405             throwUserExceptionIfNeeded(fileManagerMethod, "getModuleLocation");
   405             throwUserExceptionIfNeeded(fileManagerMethod, "getLocationForModule");
   406             return super.getModuleLocation(location, moduleName);
   406             return super.getLocationForModule(location, moduleName);
   407         }
   407         }
   408 
   408 
   409         @Override
   409         @Override
   410         public Location getModuleLocation(Location location, JavaFileObject fo, String pkgName) throws IOException {
   410         public Location getLocationForModule(Location location, JavaFileObject fo, String pkgName) throws IOException {
   411             throwUserExceptionIfNeeded(fileManagerMethod, "getModuleLocation");
   411             throwUserExceptionIfNeeded(fileManagerMethod, "getLocationForModule");
   412             return super.getModuleLocation(location, fo, pkgName);
   412             return super.getLocationForModule(location, fo, pkgName);
   413         }
   413         }
   414 
   414 
   415         @Override
   415         @Override
   416         public String inferModuleName(Location location) throws IOException {
   416         public String inferModuleName(Location location) throws IOException {
   417             throwUserExceptionIfNeeded(fileManagerMethod, "inferModuleName");
   417             throwUserExceptionIfNeeded(fileManagerMethod, "inferModuleName");
   418             return super.inferModuleName(location);
   418             return super.inferModuleName(location);
   419         }
   419         }
   420 
   420 
   421         @Override
   421         @Override
   422         public Iterable<Set<Location>> listModuleLocations(Location location) throws IOException {
   422         public Iterable<Set<Location>> listLocationsForModules(Location location) throws IOException {
   423             throwUserExceptionIfNeeded(fileManagerMethod, "listModuleLocations");
   423             throwUserExceptionIfNeeded(fileManagerMethod, "listLocationsForModules");
   424             return super.listModuleLocations(location);
   424             return super.listLocationsForModules(location);
   425         }
   425         }
   426 
   426 
   427         public FileObject wrap(FileObject fo) {
   427         public FileObject wrap(FileObject fo) {
   428             if (fileObjectMethod == null || fo == null)
   428             if (fileObjectMethod == null || fo == null)
   429                 return fo;
   429                 return fo;