Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-7583

Log tracer runs into ClassCastException for oak-queries

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Log Tracer 1.0.6, Log Tracer 1.0.4
    • Log Tracer 1.0.8
    • Extensions
    • None

    Description

      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

      Attachments

        Activity

          People

            chetanm Chetan Mehrotra
            diru Dirk Rudolph
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: