eric-maynard commented on code in PR #1068:
URL: https://github.com/apache/polaris/pull/1068#discussion_r1994038698


##########
polaris-core/src/main/java/org/apache/polaris/core/entity/CatalogEntity.java:
##########
@@ -279,6 +285,15 @@ public Builder setStorageConfigurationInfo(
       return this;
     }
 
+    /** Validate the number of allowed locations not exceeding the max value. 
*/
+    public void validateMaxAllowedLocations(
+        Collection<String> allowedLocations, int maxAllowedLocations) {
+      if (maxAllowedLocations != -1 && allowedLocations.size() > 
maxAllowedLocations) {
+        throw new IllegalArgumentException(
+            "Number of allowed locations exceeds " + maxAllowedLocations);

Review Comment:
   It looks like we can do:
   ```
         Preconditions.checkArgument(
             maxAllowedLocations != -1 && allowedLocations.size() > 
maxAllowedLocations,
             "Number of configured locations (%s) exceeds the limit of %s",
             allowedLocations.size(),
             maxAllowedLocations);
   ```
   
   This looks a little awkward to me, so if it's okay with you I may keep the 
existing exception with String.format?



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