[ 
https://issues.apache.org/jira/browse/SLING-7583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16442108#comment-16442108
 ] 

Chetan Mehrotra commented on SLING-7583:
----------------------------------------

{quote}I would propose to use {{String.valueOf()}} here to get the proper 
{{toString()}} implementation of the {{QueryImpl}} object.
{quote}
+1. Fixed as per your suggestion in 
[commit|https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-tracer.git;a=commit;h=ee13d5caf8ef714bcd2ad51d4ae414ccfbb37946]

> Log tracer runs into ClassCastException for oak-queries
> -------------------------------------------------------
>
>                 Key: SLING-7583
>                 URL: https://issues.apache.org/jira/browse/SLING-7583
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Log Tracer 1.0.6, Log Tracer 1.0.4
>            Reporter: Dirk Rudolph
>            Assignee: Chetan Mehrotra
>            Priority: Minor
>             Fix For: Log Tracer 1.0.8
>
>
> Oak's {{QueryEngineImpl}} logs the following "cost: {} for query {}" with the 
> first parameter being a primitive {{double}} and the second being an instance 
> of {{QueryImpl}} [1]. On the other hand the TraceContext casts thats second 
> parameter to {{String}} without a type check [2]. I would propose to use 
> {{String.valueOf()}} here to get the proper {{toString()}} implementation of 
> the {{QueryImpl}} object.
>   
> [1] 
> [https://github.com/apache/jackrabbit-oak/blob/jackrabbit-oak-1.6.7/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java#L311]
>  [2] 
> [https://github.com/apache/sling-org-apache-sling-tracer/blob/master/src/main/java/org/apache/sling/tracer/internal/TracerContext.java#L92]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to