adriancole commented on a change in pull request #2572: annotation query 
parsing improvements
URL: https://github.com/apache/incubator-zipkin/pull/2572#discussion_r282413781
 
 

 ##########
 File path: zipkin/src/main/java/zipkin2/storage/QueryRequest.java
 ##########
 @@ -196,10 +197,13 @@ public Builder parseAnnotationQuery(@Nullable String 
annotationQuery) {
       for (String ann : annotationQuery.split(" and ", 100)) {
         int idx = ann.indexOf('=');
         if (idx == -1) {
-          map.put(ann, "");
+          // put the annotation only if there is no key present already, 
prevents overriding more specific tags
+          map.putIfAbsent(ann.trim(), "");
 
 Review comment:
   this is a JDK 1.8 function so failing because this type is in the core 
library.
   ```suggestion
             ann = ann.trim();
             if (!map.containsKey(ann)) map.put(ann, "");
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to