gnodet-bot commented on code in PR #13494:
URL: https://github.com/apache/maven/pull/13494#discussion_r4558234570
##########
impl/maven-classworlds/src/main/java/org/codehaus/plexus/classworlds/ClassWorld.java:
##########
@@ -208,59 +215,39 @@ public synchronized void addOpens(String moduleName,
String packageName, Module
public synchronized void addReads(String sourceModuleName, Module target) {
Module source = findModule(sourceModuleName);
if (source == null) {
- LOGGER.log(
- System.Logger.Level.WARNING,
- "module-access: module ''{0}'' not found, ignoring
add-reads",
- sourceModuleName);
+ LOGGER.warning("module-access: module '" + sourceModuleName + "'
not found, ignoring add-reads directive");
return;
}
if (moduleLayerController == null) {
- LOGGER.log(
- System.Logger.Level.WARNING,
- "module-access: no ModuleLayer controller available,
cannot add-reads {0}",
- sourceModuleName);
+ LOGGER.warning("module-access: no ModuleLayer controller
available, cannot add-reads for '"
+ + sourceModuleName + "'");
return;
}
if (isBootLayerModule(source)) {
- LOGGER.log(
- System.Logger.Level.WARNING,
- "module-access: module ''{0}'' is in the boot layer and
cannot be modified at runtime;"
- + " use --add-reads {0}=ALL-UNNAMED on the JVM
command line instead",
- sourceModuleName);
+ LOGGER.warning("module-access: module '" + sourceModuleName
+ + "' is in the boot layer and cannot be modified at
runtime;"
+ + " use --add-reads on the JVM command line instead");
Review Comment:
⚠️ **Boot-layer hint loses specificity** — the old message included
`{0}=ALL-UNNAMED` making it copy-paste ready. Restore the module name and
`=ALL-UNNAMED`:
```suggestion
LOGGER.warning("module-access: module '" + sourceModuleName
+ "' is in the boot layer and cannot be modified at
runtime;"
+ " use --add-reads " + sourceModuleName + "=ALL-UNNAMED
on the JVM command line instead");
```
##########
impl/maven-classworlds/src/main/java/org/codehaus/plexus/classworlds/ClassWorld.java:
##########
@@ -208,59 +215,39 @@ public synchronized void addOpens(String moduleName,
String packageName, Module
public synchronized void addReads(String sourceModuleName, Module target) {
Module source = findModule(sourceModuleName);
if (source == null) {
- LOGGER.log(
- System.Logger.Level.WARNING,
- "module-access: module ''{0}'' not found, ignoring
add-reads",
- sourceModuleName);
+ LOGGER.warning("module-access: module '" + sourceModuleName + "'
not found, ignoring add-reads directive");
return;
}
if (moduleLayerController == null) {
- LOGGER.log(
- System.Logger.Level.WARNING,
- "module-access: no ModuleLayer controller available,
cannot add-reads {0}",
- sourceModuleName);
+ LOGGER.warning("module-access: no ModuleLayer controller
available, cannot add-reads for '"
+ + sourceModuleName + "'");
return;
}
if (isBootLayerModule(source)) {
- LOGGER.log(
- System.Logger.Level.WARNING,
- "module-access: module ''{0}'' is in the boot layer and
cannot be modified at runtime;"
- + " use --add-reads {0}=ALL-UNNAMED on the JVM
command line instead",
- sourceModuleName);
+ LOGGER.warning("module-access: module '" + sourceModuleName
+ + "' is in the boot layer and cannot be modified at
runtime;"
+ + " use --add-reads on the JVM command line instead");
return;
}
moduleLayerController.addReads(source, target);
}
private void applyModuleAccess(String moduleName, String packageName,
Module target, boolean open) {
- String directive = open ? "add-opens" : "add-exports";
Module source = findModule(moduleName);
if (source == null) {
- LOGGER.log(
- System.Logger.Level.WARNING,
- "module-access: module ''{0}'' not found, ignoring {1}
{0}/{2}",
- moduleName,
- directive,
- packageName);
+ LOGGER.warning("module-access: module '" + moduleName + "' not
found, ignoring "
+ + (open ? "add-opens" : "add-exports") + " directive for
package '" + packageName + "'");
return;
}
if (moduleLayerController == null) {
- LOGGER.log(
- System.Logger.Level.WARNING,
- "module-access: no ModuleLayer controller available,
cannot {0} {1}/{2}",
- directive,
- moduleName,
- packageName);
+ LOGGER.warning("module-access: no ModuleLayer controller
available, cannot "
+ + (open ? "add-opens" : "add-exports") + " for '" +
moduleName + "/" + packageName + "'");
return;
}
if (isBootLayerModule(source)) {
- LOGGER.log(
- System.Logger.Level.WARNING,
- "module-access: module ''{0}'' is in the boot layer and
cannot be modified at runtime;"
- + " use --{1} {0}/{2}=ALL-UNNAMED on the JVM
command line instead",
- moduleName,
- directive,
- packageName);
+ LOGGER.warning("module-access: module '" + moduleName
+ + "' is in the boot layer and cannot be modified at
runtime;"
+ + " use --" + (open ? "add-opens" : "add-exports") + " on
the JVM command line instead");
Review Comment:
⚠️ **Boot-layer hint loses specificity** — same issue as `addReads`. The old
message included `{0}/{2}=ALL-UNNAMED`, giving a copy-paste-ready flag. Restore:
```suggestion
LOGGER.warning("module-access: module '" + moduleName
+ "' is in the boot layer and cannot be modified at
runtime;"
+ " use --" + (open ? "add-opens" : "add-exports") + " "
+ moduleName + "/" + packageName + "=ALL-UNNAMED on the JVM command line
instead");
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]