mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 10:45:37 +02:00
Fix warnings.
This commit is contained in:
parent
237ac325a7
commit
6e3b4502ba
1 changed files with 4 additions and 10 deletions
|
@ -22,13 +22,13 @@ import java.nio.channels.ClosedByInterruptException;
|
||||||
import java.nio.channels.ClosedChannelException;
|
import java.nio.channels.ClosedChannelException;
|
||||||
import java.nio.channels.FileChannel;
|
import java.nio.channels.FileChannel;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database encapsulates access to a flat binary format file with a memory-manager-like API for
|
* Database encapsulates access to a flat binary format file with a memory-manager-like API for
|
||||||
* obtaining and releasing areas of storage (memory).
|
* obtaining and releasing areas of storage (memory).
|
||||||
|
@ -100,7 +100,7 @@ public class Database {
|
||||||
* @param location the local file path for the database
|
* @param location the local file path for the database
|
||||||
* @param cache the cache to be used optimization
|
* @param cache the cache to be used optimization
|
||||||
* @param version the version number to store in the database (only applicable for new databases)
|
* @param version the version number to store in the database (only applicable for new databases)
|
||||||
* @param permanentReadOnly whether this Database object will ever need writing to
|
* @param openReadOnly whether this Database object will ever need writing to
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
public Database(File location, ChunkCache cache, int version, boolean openReadOnly) throws CoreException {
|
public Database(File location, ChunkCache cache, int version, boolean openReadOnly) throws CoreException {
|
||||||
|
@ -247,9 +247,6 @@ public class Database {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocate a block out of the database.
|
* Allocate a block out of the database.
|
||||||
*
|
|
||||||
* @param size
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public int malloc(final int datasize) throws CoreException {
|
public int malloc(final int datasize) throws CoreException {
|
||||||
assert fExclusiveLock;
|
assert fExclusiveLock;
|
||||||
|
@ -468,7 +465,6 @@ public class Database {
|
||||||
* Closes the database.
|
* Closes the database.
|
||||||
* <p>
|
* <p>
|
||||||
* The behavior of any further calls to the Database is undefined
|
* The behavior of any further calls to the Database is undefined
|
||||||
* @throws IOException
|
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
public void close() throws CoreException {
|
public void close() throws CoreException {
|
||||||
|
@ -605,8 +601,7 @@ public class Database {
|
||||||
}
|
}
|
||||||
if (!dirtyChunks.isEmpty()) {
|
if (!dirtyChunks.isEmpty()) {
|
||||||
markFileIncomplete();
|
markFileIncomplete();
|
||||||
for (Iterator<Chunk> it = dirtyChunks.iterator(); it.hasNext();) {
|
for (Chunk chunk : dirtyChunks) {
|
||||||
Chunk chunk = it.next();
|
|
||||||
if (chunk.fDirty) {
|
if (chunk.fDirty) {
|
||||||
chunk.flush();
|
chunk.flush();
|
||||||
}
|
}
|
||||||
|
@ -614,8 +609,7 @@ public class Database {
|
||||||
|
|
||||||
// only after the chunks are flushed we may unlock and release them.
|
// only after the chunks are flushed we may unlock and release them.
|
||||||
synchronized (fCache) {
|
synchronized (fCache) {
|
||||||
for (Iterator<Chunk> it = dirtyChunks.iterator(); it.hasNext();) {
|
for (Chunk chunk : dirtyChunks) {
|
||||||
Chunk chunk = it.next();
|
|
||||||
chunk.fLocked= false;
|
chunk.fLocked= false;
|
||||||
if (chunk.fCacheIndex < 0) {
|
if (chunk.fCacheIndex < 0) {
|
||||||
fChunks[chunk.fSequenceNumber]= null;
|
fChunks[chunk.fSequenceNumber]= null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue