Program: 30961
Project: 30961
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>JournalWriter<T> writer(JournalMetadata<T> metadata) throws JournalException {
  if (closed) {
    LOG.info().$("String_Node_Str").$();
    return null;
  }
  final String path=metadata.getKey().getName();
  Entry e=entries.get(path);
  if (e == null) {
    e=new Entry();
    if (entries.putIfAbsent(path,e) == null) {
      try {
        e.writer=super.writer(metadata);
        if (!closed) {
          e.writer.setCloseInterceptor(this);
        }
        LOG.info().$("String_Node_Str").$(path).$("String_Node_Str").$(e.owner).$();
        return e.writer;
      }
 catch (      JournalException ex) {
        LOG.error().$("String_Node_Str").$(path).$("String_Node_Str").$(e.owner).$("String_Node_Str").$(ex).$();
        e.allocationFailure=true;
        return null;
      }
    }
 else {
      LOG.info().$("String_Node_Str").$(e.owner).$("String_Node_Str").$(path).$('\'').$();
      e=entries.get(path);
    }
  }
  long threadId=Thread.currentThread().getId();
  if (e != null && Unsafe.getUnsafe().compareAndSwapLong(e,ENTRY_OWNER,-1L,threadId)) {
    LOG.debug().$("String_Node_Str").$(e.owner).$("String_Node_Str").$(path).$();
    if (closed) {
      e.writer.setCloseInterceptor(null);
    }
    return e.writer;
  }
 else {
    if (e == null) {
      LOG.error().$("String_Node_Str").$(path).$("String_Node_Str").$();
    }
 else {
      if (e.owner == threadId) {
        if (e.allocationFailure) {
          return null;
        }
        if (closed) {
          LOG.info().$("String_Node_Str").$(path).$("String_Node_Str").$();
          e.writer.setCloseInterceptor(null);
        }
        return e.writer;
      }
      LOG.error().$("String_Node_Str").$(path).$("String_Node_Str").$(e.owner).$();
    }
  }
  return null;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>JournalWriter<T> writer(JournalMetadata<T> metadata) throws JournalException {
  if (closed) {
    LOG.info().$("String_Node_Str").$();
    return null;
  }
  final String path=metadata.getKey().getName();
  Entry e=entries.get(path);
  if (e == null) {
    e=new Entry();
    if (entries.putIfAbsent(path,e) == null) {
      try {
        JournalWriter w=super.writer(metadata);
        if (closed) {
          return w;
        }
        w.setCloseInterceptor(this);
        LOG.info().$("String_Node_Str").$(path).$("String_Node_Str").$(e.owner).$();
        return e.writer=w;
      }
 catch (      JournalException ex) {
        LOG.error().$("String_Node_Str").$(path).$("String_Node_Str").$(e.owner).$("String_Node_Str").$(ex).$();
        e.allocationFailure=true;
        return null;
      }
    }
 else {
      LOG.info().$("String_Node_Str").$(e.owner).$("String_Node_Str").$(path).$('\'').$();
      e=entries.get(path);
    }
  }
  long threadId=Thread.currentThread().getId();
  if (e != null && Unsafe.getUnsafe().compareAndSwapLong(e,ENTRY_OWNER,-1L,threadId)) {
    LOG.debug().$("String_Node_Str").$(e.owner).$("String_Node_Str").$(path).$();
    if (closed) {
      e.writer.setCloseInterceptor(null);
    }
    return e.writer;
  }
 else {
    if (e == null) {
      LOG.error().$("String_Node_Str").$(path).$("String_Node_Str").$();
    }
 else {
      if (e.owner == threadId) {
        if (e.allocationFailure) {
          return null;
        }
        if (closed) {
          LOG.info().$("String_Node_Str").$(path).$("String_Node_Str").$();
          e.writer.setCloseInterceptor(null);
        }
        return e.writer;
      }
      LOG.error().$("String_Node_Str").$(path).$("String_Node_Str").$(e.owner).$();
    }
  }
  return null;
}