private static final Logger log = Logger.getLogger(MapCache.class);
private final Map<String, SharedReference<MMapBuffer>> mappingCache = Maps.newHashMap();
public MapCache() {}
public synchronized SharedReference<MMapBuffer> copyOrOpen(String filename) throws IOException {
SharedReference<MMapBuffer> reference = mappingCache.get(filename);
<BUG>if (reference == null) {
reference = SharedReference.create(new MMapBuffer(new File(filename), FileChannel.MapMode.READ_ONLY, ByteOrder.LITTLE_ENDIAN));

mappingCache.put(filename, reference);</BUG>
}

private static final Logger log = Logger.getLogger(MapCache.class);
private final Map<String, SharedReference<MMapBuffer>> mappingCache = Maps.newHashMap();
public MapCache() {}
public synchronized SharedReference<MMapBuffer> copyOrOpen(String filename) throws IOException {
SharedReference<MMapBuffer> reference = mappingCache.get(filename);
if (reference == null) {
final File file;
final MMapBuffer mmapBuf;
final CachedFile cf = CachedFile.create(filename);
file = cf.loadFile();
mmapBuf = new MMapBuffer(file, FileChannel.MapMode.READ_ONLY, ByteOrder.LITTLE_ENDIAN);
reference = SharedReference.create(mmapBuf);
mappingCache.put(filename, reference);
}
