mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
b689c5bc37
commit
1eaf5662fe
1 changed files with 14 additions and 15 deletions
|
@ -91,9 +91,9 @@ public class Database {
|
|||
private final File fLocation;
|
||||
private final boolean fReadOnly;
|
||||
private RandomAccessFile fFile;
|
||||
private boolean fExclusiveLock= false; // necessary for any write operation
|
||||
private boolean fExclusiveLock; // necessary for any write operation
|
||||
private boolean fLocked; // necessary for any operation.
|
||||
private boolean fIsMarkedIncomplete= false;
|
||||
private boolean fIsMarkedIncomplete;
|
||||
|
||||
private int fVersion;
|
||||
private final Chunk fHeaderChunk;
|
||||
|
@ -151,7 +151,7 @@ public class Database {
|
|||
fFile.getChannel().read(buf, position);
|
||||
return;
|
||||
} catch (ClosedChannelException e) {
|
||||
// bug 219834 file may have be closed by interrupting a thread during an I/O operation.
|
||||
// Bug 219834 file may have be closed by interrupting a thread during an I/O operation.
|
||||
reopen(e, ++retries);
|
||||
}
|
||||
} while (true);
|
||||
|
@ -164,14 +164,14 @@ public class Database {
|
|||
fFile.getChannel().write(buf, position);
|
||||
return;
|
||||
} catch (ClosedChannelException e) {
|
||||
// bug 219834 file may have be closed by interrupting a thread during an I/O operation.
|
||||
// Bug 219834 file may have be closed by interrupting a thread during an I/O operation.
|
||||
reopen(e, ++retries);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void reopen(ClosedChannelException e, int attempt) throws ClosedChannelException, FileNotFoundException {
|
||||
// only if the current thread was not interrupted we try to reopen the file.
|
||||
// Only if the current thread was not interrupted we try to reopen the file.
|
||||
if (e instanceof ClosedByInterruptException || attempt >= 20) {
|
||||
throw e;
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ public class Database {
|
|||
while (position < size) {
|
||||
nRead = from.transferTo(position, 4096 * 16, target);
|
||||
if (nRead == 0) {
|
||||
break; // should not happen
|
||||
break; // Should not happen
|
||||
} else {
|
||||
position+= nRead;
|
||||
}
|
||||
|
@ -695,8 +695,7 @@ public class Database {
|
|||
}
|
||||
// also handles header chunk
|
||||
flushAndUnlockChunks(dirtyChunks, flush);
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
fExclusiveLock= false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue