Program: 30981
Project: 30981
Buggy source:
@SuppressWarnings("String_Node_Str") <T>Journal<T> reader(JournalMetadata<T> metadata) throws JournalException {
  if (closed == TRUE) {
    LOG.info().$("String_Node_Str");
    throw FactoryClosedException.INSTANCE;
  }
  String name=metadata.getName();
  Entry e=entries.get(name);
  long thread=Thread.currentThread().getId();
  if (e == null) {
    LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(name).$('\'').$();
    e=new Entry(0);
    Entry other=entries.putIfAbsent(name,e);
    if (other != null) {
      e=other;
      LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(name).$('\'').$();
    }
 else {
      if (getConfiguration().exists(name) != JournalConfiguration.EXISTS) {
        LOG.info().$("String_Node_Str").$(name).$("String_Node_Str").$();
        throw JournalDoesNotExistException.INSTANCE;
      }
      LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(name).$('\'').$();
    }
  }
  long lockOwner=e.lockOwner;
  if (lockOwner != UNLOCKED) {
    LOG.info().$("String_Node_Str").$(name).$("String_Node_Str").$(lockOwner).$();
    throw JournalLockedException.INSTANCE;
  }
  do {
    for (int i=0; i < ENTRY_SIZE; i++) {
      if (Unsafe.cas(e.allocations,i,FactoryConstants.UNALLOCATED,thread)) {
        R r=Unsafe.arrayGet(e.readers,i);
        if (r == null) {
          LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(name).$("String_Node_Str").$(e.index).$(',').$(i).$(')').$();
          r=new R(e,i,metadata,new File(getConfiguration().getJournalBase(),metadata.getName()));
          if (closed == TRUE) {
            return r;
          }
          Unsafe.arrayPut(e.readers,i,r);
          r.setCloseInterceptor(this);
        }
 else {
          LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(name).$("String_Node_Str").$(e.index).$(',').$(i).$();
          r.refresh();
        }
        if (closed == TRUE) {
          Unsafe.arrayPut(e.readers,i,null);
          r.setCloseInterceptor(null);
        }
        return r;
      }
    }
    LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(e.index + 1).$();
    if (Unsafe.getUnsafe().compareAndSwapInt(e,NEXT_STATUS,0,1)) {
      LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(e.index + 1).$();
      e.next=new Entry(e.index + 1);
    }
    e=e.next;
  }
 while (e != null && e.index < maxSegments);
  LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(this.maxSegments).$(')').$();
  throw FactoryFullException.INSTANCE;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") <T>Journal<T> reader(JournalMetadata<T> metadata) throws JournalException {
  if (closed == TRUE) {
    LOG.info().$("String_Node_Str");
    throw FactoryClosedException.INSTANCE;
  }
  String name=metadata.getName();
  Entry e=entries.get(name);
  long thread=Thread.currentThread().getId();
  if (e == null) {
    LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(name).$('\'').$();
    e=new Entry(0);
    Entry other=entries.putIfAbsent(name,e);
    if (other != null) {
      e=other;
      LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(name).$('\'').$();
    }
 else {
      if (getConfiguration().exists(name) != JournalConfiguration.EXISTS) {
        LOG.info().$("String_Node_Str").$(name).$("String_Node_Str").$();
        throw JournalDoesNotExistException.INSTANCE;
      }
      LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(name).$('\'').$();
    }
  }
  long lockOwner=e.lockOwner;
  if (lockOwner != UNLOCKED) {
    LOG.info().$("String_Node_Str").$(name).$("String_Node_Str").$(lockOwner).$();
    throw JournalLockedException.INSTANCE;
  }
  do {
    for (int i=0; i < ENTRY_SIZE; i++) {
      if (Unsafe.cas(e.allocations,i,FactoryConstants.UNALLOCATED,thread)) {
        R r=Unsafe.arrayGet(e.readers,i);
        if (r == null) {
          LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(name).$("String_Node_Str").$(e.index).$(',').$(i).$(')').$();
          r=new R(e,i,metadata,new File(getConfiguration().getJournalBase(),metadata.getName()));
          if (closed == TRUE) {
            return r;
          }
          Unsafe.arrayPut(e.readers,i,r);
          r.setCloseInterceptor(this);
        }
 else {
          LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(name).$("String_Node_Str").$(e.index).$(',').$(i).$(')').$();
          r.refresh();
        }
        if (closed == TRUE) {
          Unsafe.arrayPut(e.readers,i,null);
          r.setCloseInterceptor(null);
        }
        return r;
      }
    }
    LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(e.index + 1).$();
    if (Unsafe.getUnsafe().compareAndSwapInt(e,NEXT_STATUS,0,1)) {
      LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(e.index + 1).$();
      e.next=new Entry(e.index + 1);
    }
    e=e.next;
  }
 while (e != null && e.index < maxSegments);
  LOG.info().$("String_Node_Str").$(thread).$("String_Node_Str").$(this.maxSegments).$(')').$();
  throw FactoryFullException.INSTANCE;
}