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

Incorrect usage of ServiceTracker.size() in UPnP Plugin

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      There seems to be a small problem with the tracking code especially with the following line (Activator.java):

      if (tracker.size() <= 1 && plugin != null)

      ...
      ServiceTrackerCustomizer.removedService() is supposed to be called AFTER the service is no longer tracked. So in that method the size must be already decremented. The code above will unregister the plugin if only one UPnP device left in the system and it wouldn't be accessible through the web console.

      The correct code is:

      if (tracker.size() == 0 && plugin != null)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            v_valchev Valentin Valchev
            v_valchev Valentin Valchev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment