You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zipkin.apache.org by GitBox <gi...@apache.org> on 2019/05/09 09:44:24 UTC

[GitHub] [incubator-zipkin] adriancole commented on a change in pull request #2572: annotation query parsing improvements

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:
users@infra.apache.org


With regards,
Apache Git Services