Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2882

It's dangerous to use service instances as keys in a Map (in the http whiteboard bundle).

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • http-2.2.0
    • http-2.2.1
    • HTTP Service
    • None

    Description

      In ExtenderManagerImpl.addMapping() the key that is used to store a tuple in a Map is actually the service instance that you get from the ServiceTracker. This is dangerous because you have absolutely no idea if that instance correctly implements equals() and hashCode(). It's usually better to use the ServiceReference as the key (which is guaranteed to correctly implement those methods). It's probably only a minor issue in practice, but still one you can look for a long time if it does bite you.

      Attachments

        Activity

          People

            fmeschbe Felix Meschberger
            marrs Marcel Offermans
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: