marschall / memoryfilesystem

An in memory implementation of a JSR-203 file system
282 stars 36 forks source link

Ensure that accessing creationTime(), lastModifiedTime() and lastAccessTime() is done it a read lock #117

Closed glhez closed 5 years ago

glhez commented 5 years ago

The following commit removes three method (one probably returning the wrong value) in MemoryEntry and uses a functional interface to pass in the appropriate information after reading them.

marschall commented 5 years ago

Thank you. I ended up redoing the PR in 867bd8cdad577b862a37f2c138fe26b3cd008439 for two reasons.

  1. a lot of formatting changes crept in which made it more difficult that necessary to review
  2. I believe it is necessary to hold the lock longer to ensure a consistent result is returned.

Yes, one the the methods returned the wrong value but AFAIK was not used anywhere.