Memory not released in SoftRefFilesCache
----------------------------------------

                 Key: VFS-221
                 URL: https://issues.apache.org/jira/browse/VFS-221
             Project: Commons VFS
          Issue Type: Bug
         Environment: All
            Reporter: Gilles Gaillard
            Priority: Trivial


Implementation of method putFile(final FileObject file) does not remove 
references from refReverseMap when adding a new file.

#current implementation
{noformat}
     synchronized (files)
    {
      files.put(file.getName(), ref);
      synchronized(refReverseMap)
      {
        refReverseMap.put(ref, key);
      }
    }
{noformat}

#should become:
{noformat}
    synchronized (files)
    {
      Reference old = files.put(file.getName(), ref);
      synchronized(refReverseMap)
      {
          refReverseMap.remove(old);
          refReverseMap.put(ref, key);
      }
    }
{noformat}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to