karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Hammerbacher (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KARAF-3873) TimeoutTask doesn't correctly remove pending commands
Date Thu, 23 Jul 2015 17:51:04 GMT
Joe Hammerbacher created KARAF-3873:
---------------------------------------

             Summary: TimeoutTask doesn't correctly remove pending commands
                 Key: KARAF-3873
                 URL: https://issues.apache.org/jira/browse/KARAF-3873
             Project: Karaf
          Issue Type: Bug
          Components: cellar-core
    Affects Versions: 4.0.0, cellar-3.0.3
            Reporter: Joe Hammerbacher


{{TimeoutTask}} uses the following code to attempt to remove pending commands after the timeout
period has expired:

{noformat}
        Boolean pending = store.getPending().containsKey(command);
        if (pending) {
            store.getPending().remove(command);
        }
{noformat}

However, the keys for the {{ConcurrentMap}} returned by {{getPending()}} are of type {{String}},
not {{Command}}. As a result, {{pending}} is always {{false}} (and even if it were {{true}},
{{remove}} would fail to do anything).

The intended functionality is likely:

{noformat}
        Boolean pending = store.getPending().containsKey(command.getId());
        if (pending) {
            store.getPending().remove(command.getId());
        }
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message