Uploaded image for project: 'Terrier Core'
  1. Terrier Core
  2. TR-178

Private method setPostingImplementation in BitPostingIndex

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.6
    • Component/s: .structures
    • Labels:
      None

      Description

      The private method setPostingImplementation in BitPostingIndex has been introduced in Terrier 3.5. In this method, the IterablePosting implementation constructor is "preloaded". In Terrier 3.0, it was "obtained directly in the public getPostings method.
      Now it is impossible to overload the setPostingImplementation method, then the aforementioned constructor is "hard coded" in terms of parameters:

      postingConstructor = (fieldCount > 0)
      ? postingImplementation.getConstructor(BitIn.class, Integer.TYPE, DocumentIndex.class, Integer.TYPE)
      : postingImplementation.getConstructor(BitIn.class, Integer.TYPE, DocumentIndex.class);

      If someone provides a new implementation of IterablePosting (e.g., using skips) with a different constructor signature, now it is impossible to obtain that constructor because of reflection issues.

        Attachments

          Activity

          Hide
          craigm Craig Macdonald added a comment -

          Trivial fix: committed for 3.6

          Show
          craigm Craig Macdonald added a comment - Trivial fix: committed for 3.6

            People

            • Assignee:
              craigm Craig Macdonald
              Reporter:
              nicola.tonellotto Nicola Tonellotto
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: