olamy commented on code in PR #489:
URL: 
https://github.com/apache/maven-build-cache-extension/pull/489#discussion_r3246266743


##########
src/main/java/org/apache/maven/buildcache/xml/CacheConfigImpl.java:
##########
@@ -568,7 +569,12 @@ public String getTransport() {
     @Override
     public int getMaxLocalBuildsCached() {
         checkInitializedState();
-        return getLocal().getMaxBuildsCached();
+        int maxLocalBuildsCached =
+                getProperty(MAX_LOCAL_BUILDS_CACHED_PROPERTY_NAME, 
getLocal().getMaxBuildsCached());
+        if (maxLocalBuildsCached <= 0) {
+            throw new IllegalArgumentException("maxLocalBuildsCached must be 
greater than 0");

Review Comment:
   as far as I can see the only way to pass is to Maven is using a system 
property (`-D`) I can try modify core to support new cli arg such 
`--max-local-build-cached` but the PR might be refused in maven core. and the 
other here is a configuration file. So I find this human friendly to have a 
proper error message is not correct rather than non human readable stacktrace 
with same Stackoverflow because an loop on a array starts with a wrong index 
and the user does not have any chance to understand his mistake except looking 
at the sources.



-- 
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]

Reply via email to