Skip to content

Commit

Permalink
Imrpoved docs/naming
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Sep 29, 2023
1 parent 7680e56 commit 842f507
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/cryptomator/frontend/fuse/OpenFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public int write(ByteBuffer buf, long num, long offset) throws IOException {
}

/**
* Tests, if the write method of this open file was called at least once.
* Tests, if this OpenFile is <em>dirty</em>.
* An OpenFile is dirty, if its write method is called at least once.
*
* @return {@code true} if {@link OpenFile#write(ByteBuffer, long, long)} was called on this object, otherwise {@code false}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ public void close(long fileHandle) throws ClosedChannelException, IOException {
}

/**
* Tests, if there exists dirty {@link OpenFile}s
* This method is neither atomic regarding the set of open files nor regarding each open file individually. Therefore, external synchronization is required.
* Tests, if any {@link OpenFile} is considered <em>dirty</em>, e.g. might have pending changes.
* This method is neither atomic regarding the set of OpenFiles nor regarding each OpenFile individually. Therefore, external synchronization is required.
*
* @return {@code true} if and only if at least one dirty {@link OpenFile} exists. Otherwise {@code false}.
* @see OpenFile#isDirty()
*/
boolean hastDirtyOpenFiles() {
boolean hasDirtyFiles() {
return openFiles.entrySet().stream().anyMatch(entry -> entry.getValue().isDirty());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public void destroy() {
@Override
public boolean isInUse() {
try (PathLock pLock = lockManager.tryLockForWriting("/")) {
return openFiles.hastDirtyOpenFiles();
return openFiles.hasDirtyFiles();
} catch (AlreadyLockedException e) {
return true;
}
Expand Down

0 comments on commit 842f507

Please sign in to comment.