fabriziofortino commented on a change in pull request #311:
URL: https://github.com/apache/jackrabbit-oak/pull/311#discussion_r663995765



##########
File path: 
oak-query-spi/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java
##########
@@ -491,6 +510,17 @@ public IndexPlan build() {
                     private final boolean deprecated =
                             Builder.this.deprecated;
                     private final boolean logWarningForPathFilterMismatch = 
Builder.this.logWarningForPathFilterMismatch;
+                    private final Map<Level, List<String>> additionalMessages 
= Builder.this.additionalMessages;
+
+                    private String getAdditionalMessageString() {
+                        StringBuilder stringBuilder = new StringBuilder();

Review comment:
       I don't think this is completely safe. If there are no additional 
messages, the StringBuilder would call `deleteCharAt` with a negative value. 
You could make it more concise and functional using streams
   
   ```java
   private String getAdditionalMessageString() {
       return additionalMessages.entrySet().stream()
               .map(e -> e.getKey() + " : " + e.getValue())
               .collect(Collectors.joining(", "));
   }
   ```

##########
File path: 
oak-query-spi/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java
##########
@@ -353,6 +356,10 @@ default boolean logWarningForPathFilterMismatch() {
             return false;
         }
 
+        default Map<Level, List<String>> getAdditionalMessages() {

Review comment:
       can you add some javadoc here?




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