@@ -165,7 +165,7 @@ public class ElementsTable {
165
165
private final List <Location > locations ;
166
166
private final Modules modules ;
167
167
private final ToolOptions options ;
168
- private final Messager messager ;
168
+ private final JavadocLog log ;
169
169
private final JavaCompiler compiler ;
170
170
171
171
private final Map <String , Entry > entries = new LinkedHashMap <>();
@@ -210,7 +210,7 @@ public class ElementsTable {
210
210
this .fm = toolEnv .fileManager ;
211
211
this .modules = Modules .instance (context );
212
212
this .options = options ;
213
- this .messager = Messager .instance0 (context );
213
+ this .log = JavadocLog .instance0 (context );
214
214
this .compiler = JavaCompiler .instance (context );
215
215
Source source = Source .instance (context );
216
216
@@ -370,19 +370,19 @@ void sanityCheckSourcePathModules(List<String> moduleNames) throws ToolException
370
370
return ;
371
371
372
372
if (moduleNames .size () > 1 ) {
373
- String text = messager .getText ("main.cannot_use_sourcepath_for_modules" ,
373
+ String text = log .getText ("main.cannot_use_sourcepath_for_modules" ,
374
374
String .join (", " , moduleNames ));
375
375
throw new ToolException (CMDERR , text );
376
376
}
377
377
378
378
String foundModule = getModuleName (StandardLocation .SOURCE_PATH );
379
379
if (foundModule == null ) {
380
- String text = messager .getText ("main.module_not_found_on_sourcepath" , moduleNames .get (0 ));
380
+ String text = log .getText ("main.module_not_found_on_sourcepath" , moduleNames .get (0 ));
381
381
throw new ToolException (CMDERR , text );
382
382
}
383
383
384
384
if (!moduleNames .get (0 ).equals (foundModule )) {
385
- String text = messager .getText ("main.sourcepath_does_not_contain_module" , moduleNames .get (0 ));
385
+ String text = log .getText ("main.sourcepath_does_not_contain_module" , moduleNames .get (0 ));
386
386
throw new ToolException (CMDERR , text );
387
387
}
388
388
}
@@ -399,7 +399,7 @@ private String getModuleName(Location location) throws ToolException {
399
399
}
400
400
}
401
401
} catch (IOException ioe ) {
402
- String text = messager .getText ("main.file.manager.list" , location );
402
+ String text = log .getText ("main.file.manager.list" , location );
403
403
throw new ToolException (SYSERR , text , ioe );
404
404
}
405
405
return null ;
@@ -413,7 +413,7 @@ ElementsTable scanSpecifiedItems() throws ToolException {
413
413
for (String m : modules ) {
414
414
List <Location > moduleLocations = getModuleLocation (locations , m );
415
415
if (moduleLocations .isEmpty ()) {
416
- String text = messager .getText ("main.module_not_found" , m );
416
+ String text = log .getText ("main.module_not_found" , m );
417
417
throw new ToolException (CMDERR , text );
418
418
}
419
419
if (moduleLocations .contains (StandardLocation .SOURCE_PATH )) {
@@ -520,7 +520,7 @@ private Iterable<JavaFileObject> fmList(Location location,
520
520
try {
521
521
return fm .list (location , packagename , kinds , recurse );
522
522
} catch (IOException ioe ) {
523
- String text = messager .getText ("main.file.manager.list" , packagename );
523
+ String text = log .getText ("main.file.manager.list" , packagename );
524
524
throw new ToolException (SYSERR , text , ioe );
525
525
}
526
526
}
@@ -567,7 +567,7 @@ private Set<ModuleElement> getModuleRequires(ModuleElement mdle, boolean onlyTra
567
567
if (!isMandated (mdle , rd ) && onlyTransitive == rd .isTransitive ()) {
568
568
if (!haveModuleSources (dep )) {
569
569
if (!warnedNoSources .contains (dep )) {
570
- messager .printWarningUsingKey (dep , "main.module_source_not_found" , dep .getQualifiedName ());
570
+ log .printWarningUsingKey (dep , "main.module_source_not_found" , dep .getQualifiedName ());
571
571
warnedNoSources .add (dep );
572
572
}
573
573
}
@@ -759,7 +759,7 @@ private void computeSpecifiedPackages() throws ToolException {
759
759
if (pkg != null ) {
760
760
packlist .add (pkg );
761
761
} else {
762
- messager .printWarningUsingKey ("main.package_not_found" , modpkg .toString ());
762
+ log .printWarningUsingKey ("main.package_not_found" , modpkg .toString ());
763
763
}
764
764
});
765
765
specifiedPackageElements = Collections .unmodifiableSet (packlist );
@@ -780,7 +780,7 @@ private void computeSpecifiedTypes() throws ToolException {
780
780
for (String className : classArgList ) {
781
781
TypeElement te = toolEnv .loadClass (className );
782
782
if (te == null ) {
783
- String text = messager .getText ("javadoc.class_not_found" , className );
783
+ String text = log .getText ("javadoc.class_not_found" , className );
784
784
throw new ToolException (CMDERR , text );
785
785
} else {
786
786
addAllClasses (classes , te , true );
@@ -796,7 +796,7 @@ private void addFilesForParser(Collection<JavaFileObject> result,
796
796
toolEnv .notice ("main.Loading_source_files_for_package" , modpkg .toString ());
797
797
List <JavaFileObject > files = getFiles (modpkg , recurse );
798
798
if (files .isEmpty ()) {
799
- String text = messager .getText ("main.no_source_files_for_package" ,
799
+ String text = log .getText ("main.no_source_files_for_package" ,
800
800
modpkg .toString ());
801
801
throw new ToolException (CMDERR , text );
802
802
} else {
@@ -909,7 +909,7 @@ private Location getModuleLocation(Location location, String msymName) throws To
909
909
try {
910
910
return fm .getLocationForModule (location , msymName );
911
911
} catch (IOException ioe ) {
912
- String text = messager .getText ("main.doclet_could_not_get_location" , msymName );
912
+ String text = log .getText ("main.doclet_could_not_get_location" , msymName );
913
913
throw new ToolException (ERROR , text , ioe );
914
914
}
915
915
}
@@ -956,9 +956,9 @@ private void addAllClasses(Collection<TypeElement> list, TypeElement typeElement
956
956
}
957
957
} catch (CompletionFailure e ) {
958
958
if (e .getMessage () != null )
959
- messager .printWarning (e .getMessage ());
959
+ log .printWarning (e .getMessage ());
960
960
else
961
- messager .printWarningUsingKey ("main.unexpected.exception" , e );
961
+ log .printWarningUsingKey ("main.unexpected.exception" , e );
962
962
}
963
963
}
964
964
0 commit comments