Program: 30966
Project: 30966
Buggy source:
@SuppressWarnings("String_Node_Str") <T>JournalWriter<T> writer(JournalMetadata<T> metadata) throws JournalException {
  if (metadata.isPartialMapped()) {
    throw JournalPartiallyMappedException.INSTANCE;
  }
  if (closed) {
    LOG.info().$("String_Node_Str").$();
    throw FactoryClosedException.INSTANCE;
  }
  final String name=metadata.getKey().getName();
  long thread=Thread.currentThread().getId();
  Entry e=entries.get(name);
  if (e == null) {
    e=new Entry();
    if (entries.putIfAbsent(name,e) == null) {
      createWriter(thread,name,e,metadata);
      return e.writer;
    }
 else {
      LOG.info().$("String_Node_Str").$(e.owner).$("String_Node_Str").$(name).$('\'').$();
      e=entries.get(name);
    }
  }
  if (e != null && Unsafe.getUnsafe().compareAndSwapLong(e,ENTRY_OWNER,-1L,thread)) {
    if (closed) {
      e.writer.setCloseInterceptor(null);
    }
    return checkAndReturn(thread,e,name,metadata);
  }
 else {
    if (e == null) {
      LOG.error().$("String_Node_Str").$(name).$("String_Node_Str").$();
      throw FactoryInternalException.INSTANCE;
    }
 else {
      long owner=e.owner;
      if (owner == thread) {
        if (e.locked) {
          throw JournalLockedException.INSTANCE;
        }
        if (e.ex != null) {
          notifyListener(thread,name,FactoryEventListener.EV_EX_RESEND);
          throw e.ex;
        }
        if (closed) {
          LOG.info().$("String_Node_Str").$(name).$("String_Node_Str").$();
          e.writer.setCloseInterceptor(null);
        }
        return checkAndReturn(thread,e,name,metadata);
      }
      LOG.error().$("String_Node_Str").$(name).$("String_Node_Str").$(owner).$();
      throw WriterBusyException.INSTANCE;
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") <T>JournalWriter<T> writer(JournalMetadata<T> metadata) throws JournalException {
  if (metadata.isPartialMapped()) {
    throw JournalPartiallyMappedException.INSTANCE;
  }
  if (closed) {
    LOG.info().$("String_Node_Str").$();
    throw FactoryClosedException.INSTANCE;
  }
  final String name=metadata.getKey().getName();
  long thread=Thread.currentThread().getId();
  Entry e=entries.get(name);
  if (e == null) {
    e=new Entry();
    if (entries.putIfAbsent(name,e) == null) {
      return createWriter(thread,name,e,metadata);
    }
 else {
      LOG.info().$("String_Node_Str").$(e.owner).$("String_Node_Str").$(name).$('\'').$();
      e=entries.get(name);
    }
  }
  if (e != null && Unsafe.getUnsafe().compareAndSwapLong(e,ENTRY_OWNER,-1L,thread)) {
    if (e.writer == null) {
      return createWriter(thread,name,e,metadata);
    }
    if (closed) {
      e.writer.setCloseInterceptor(null);
    }
    return checkAndReturn(thread,e,name,metadata);
  }
 else {
    if (e == null) {
      LOG.error().$("String_Node_Str").$(name).$("String_Node_Str").$();
      throw FactoryInternalException.INSTANCE;
    }
 else {
      long owner=e.owner;
      if (owner == thread) {
        if (e.locked) {
          throw JournalLockedException.INSTANCE;
        }
        if (e.ex != null) {
          notifyListener(thread,name,FactoryEventListener.EV_EX_RESEND);
          throw e.ex;
        }
        if (closed) {
          LOG.info().$("String_Node_Str").$(name).$("String_Node_Str").$();
          e.writer.setCloseInterceptor(null);
        }
        return checkAndReturn(thread,e,name,metadata);
      }
      LOG.error().$("String_Node_Str").$(name).$("String_Node_Str").$(owner).$();
      throw WriterBusyException.INSTANCE;
    }
  }
}