Skip to content

Commit b61ef66

Browse files
committed
Address PR review comments
- Change LOGGER.error to LOGGER.warn for unknown parameter validation Unknown parameters may legitimately occur when users manually correct outdated bundled configs, so warning level is more appropriate. - Use ConcurrentHashMap instead of HashMap in PluginParameterLoader Ensures thread safety in multi-threaded Maven builds where the cache may be accessed from different worker threads. Addresses review comments from: - #389 (review) - #389 (review)
1 parent 4b1679f commit b61ef66

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/org/apache/maven/buildcache/xml/CacheConfigImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ private void validateReconciliationConfig(GoalReconciliation config, Plugin plug
334334
String propertyName = property.getPropertyName();
335335

336336
if (!goalDef.hasParameter(propertyName)) {
337-
LOGGER.error(
337+
LOGGER.warn(
338338
"Unknown parameter '{}' in reconciliation config for {}:{} version {}. "
339339
+ "This may indicate a plugin version mismatch or renamed parameter. "
340340
+ "Consider updating parameter definition or removing from reconciliation.",

src/main/java/org/apache/maven/buildcache/xml/PluginParameterLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import javax.xml.parsers.DocumentBuilderFactory;
2323

2424
import java.io.InputStream;
25-
import java.util.HashMap;
2625
import java.util.Map;
26+
import java.util.concurrent.ConcurrentHashMap;
2727

2828
import org.apache.maven.buildcache.xml.PluginParameterDefinition.GoalParameterDefinition;
2929
import org.apache.maven.buildcache.xml.PluginParameterDefinition.ParameterDefinition;
@@ -43,7 +43,7 @@ public class PluginParameterLoader {
4343
private static final Logger LOGGER = LoggerFactory.getLogger(PluginParameterLoader.class);
4444
private static final String PARAMETER_DIR = "plugin-parameters/";
4545

46-
private final Map<String, PluginParameterDefinition> definitions = new HashMap<>();
46+
private final Map<String, PluginParameterDefinition> definitions = new ConcurrentHashMap<>();
4747

4848
/**
4949
* Load parameter definitions for a plugin by artifact ID only (no version matching)

0 commit comments

Comments
 (0)