newInputStream and newOutputStream are not atomic:
They first call #getEntry which releases the lock and does not increment the open count. Only after this are the streams created and the open count incremented. This allows for a race where file can be deleted between #getEntry returning and the stream being created.
newInputStream
andnewOutputStream
are not atomic:They first call
#getEntry
which releases the lock and does not increment the open count. Only after this are the streams created and the open count incremented. This allows for a race where file can be deleted between#getEntry
returning and the stream being created.