@Override public long getSize() { if(!indexFile.canRead()) { return 0; } Throwable throwable; Lock lock = readWriteLock.readLock(); lock.lock(); // FindBugs "Multithreaded correctness - Method does not release lock on all exception paths" is a false positive try(RandomAccessFile raf = new RandomAccessFile(indexFile, "r")) { return internalGetSize(raf); } catch(Throwable e) { throwable = e; } finally { lock.unlock(); } // it's a really bad idea to log while locked *sigh* if(logger.isDebugEnabled()) logger.debug("Couldn't retrieve size!", throwable); return 0; }
@Override public long getSize() { if(!indexFile.canRead()) { return 0; } Throwable throwable; Lock lock = readWriteLock.readLock(); lock.lock(); // FindBugs "Multithreaded correctness - Method does not release lock on all exception paths" is a false positive try(RandomAccessFile raf = new RandomAccessFile(indexFile, "r")) { return internalGetSize(raf); } catch(Throwable e) { throwable = e; } finally { lock.unlock(); } // it's a really bad idea to log while locked *sigh* if(logger.isDebugEnabled()) logger.debug("Couldn't retrieve size!", throwable); return 0; }
elementsCount = internalGetSize(randomSerializeIndexFile); if(index >= 0 && index < elementsCount)
elementsCount = internalGetSize(randomSerializeIndexFile); if(index >= 0 && index < elementsCount)
RandomAccessFile randomSerializeFile = new RandomAccessFile(dataFile, "rw")) long elementsCount = internalGetSize(randomSerializeIndexFile);
RandomAccessFile randomSerializeFile = new RandomAccessFile(dataFile, "rw")) long elementsCount = internalGetSize(randomSerializeIndexFile);
RandomAccessFile randomSerializeFile = new RandomAccessFile(dataFile, "rw")) long elementsCount = internalGetSize(randomSerializeIndexFile);
RandomAccessFile randomSerializeFile = new RandomAccessFile(dataFile, "rw")) long elementsCount = internalGetSize(randomSerializeIndexFile);