Program: 188435
Project: 188435
Buggy source:
private CloseableIterable<OptionalWithCause<LogEntry>> listLogEntries(){
  boolean recursive=false;
  CloseableIterable<OptionalWithCause<LogEntry>> inStorage=null;
  CloseableIterable<OptionalWithCause<LogEntry>> notStorage=null;
  try {
    final CloseableIterable<Resource> actionLogs=getStorage().listResourcesUnderContainer(DefaultStoragePath.parse(RodaConstants.STORAGE_CONTAINER_ACTIONLOG),recursive);
    inStorage=new CloseableIterable<OptionalWithCause<LogEntry>>(){
      @Override public void close() throws IOException {
        actionLogs.close();
      }
      @Override public Iterator<OptionalWithCause<LogEntry>> iterator(){
        Iterator<Resource> resources=actionLogs.iterator();
        return new Iterator<OptionalWithCause<LogEntry>>(){
          LogEntry nextLogEntry=null;
          BufferedReader br=null;
          @Override public boolean hasNext(){
            if (nextLogEntry == null) {
              while (resources.hasNext()) {
                try {
                  Resource resource=resources.next();
                  if (resource instanceof Binary) {
                    Binary b=(Binary)resource;
                    br=new BufferedReader(new InputStreamReader(b.getContent().createInputStream()));
                    String nextLine=null;
                    if ((nextLine=br.readLine()) != null) {
                      nextLogEntry=JsonUtils.getObjectFromJson(nextLine,LogEntry.class);
                      break;
                    }
                  }
                }
 catch (                GenericException|IOException e) {
                }
              }
            }
            return nextLogEntry != null;
          }
          @Override public OptionalWithCause<LogEntry> next(){
            OptionalWithCause<LogEntry> entry=OptionalWithCause.of(nextLogEntry);
            try {
              String nextLine=null;
              if ((nextLine=br.readLine()) == null) {
                IOUtils.closeQuietly(br);
                while (resources.hasNext()) {
                  try {
                    Resource resource=resources.next();
                    if (resource instanceof Binary) {
                      Binary b=(Binary)resource;
                      br=new BufferedReader(new InputStreamReader(b.getContent().createInputStream()));
                      if ((nextLine=br.readLine()) != null) {
                        nextLogEntry=JsonUtils.getObjectFromJson(nextLine,LogEntry.class);
                        break;
                      }
                    }
                  }
 catch (                  GenericException|IOException e) {
                  }
                }
              }
 else {
                nextLogEntry=JsonUtils.getObjectFromJson(nextLine,LogEntry.class);
              }
            }
 catch (            GenericException|IOException e) {
              nextLogEntry=null;
            }
            return entry;
          }
        }
;
      }
    }
;
  }
 catch (  NotFoundException|GenericException|AuthorizationDeniedException|RequestNotValidException e) {
    LOGGER.error("String_Node_Str",e);
  }
  try {
    DirectoryStream<Path> directoryStream=Files.newDirectoryStream(RodaCoreFactory.getLogPath());
    notStorage=new CloseableIterable<OptionalWithCause<LogEntry>>(){
      @Override public void close() throws IOException {
        directoryStream.close();
      }
      @Override public Iterator<OptionalWithCause<LogEntry>> iterator(){
        Iterator<Path> paths=directoryStream.iterator();
        return new Iterator<OptionalWithCause<LogEntry>>(){
          LogEntry nextLogEntry=null;
          BufferedReader br=null;
          @Override public boolean hasNext(){
            if (nextLogEntry == null) {
              while (paths.hasNext()) {
                try {
                  Path logFile=paths.next();
                  br=new BufferedReader(new InputStreamReader(Files.newInputStream(logFile)));
                  String nextLine=null;
                  if ((nextLine=br.readLine()) != null) {
                    nextLogEntry=JsonUtils.getObjectFromJson(nextLine,LogEntry.class);
                    break;
                  }
                }
 catch (                GenericException|IOException e) {
                }
              }
            }
            return nextLogEntry != null;
          }
          @Override public OptionalWithCause<LogEntry> next(){
            OptionalWithCause<LogEntry> entry=OptionalWithCause.of(nextLogEntry);
            try {
              String nextLine=null;
              if ((nextLine=br.readLine()) == null) {
                IOUtils.closeQuietly(br);
                while (paths.hasNext()) {
                  try {
                    Path logFile=paths.next();
                    br=new BufferedReader(new InputStreamReader(Files.newInputStream(logFile)));
                    if ((nextLine=br.readLine()) != null) {
                      nextLogEntry=JsonUtils.getObjectFromJson(nextLine,LogEntry.class);
                      break;
                    }
                  }
 catch (                  GenericException|IOException e) {
                  }
                }
              }
 else {
                nextLogEntry=JsonUtils.getObjectFromJson(nextLine,LogEntry.class);
              }
            }
 catch (            GenericException|IOException e) {
              nextLogEntry=null;
            }
            return entry;
          }
        }
;
      }
    }
;
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
  return CloseableIterables.concat(inStorage,notStorage);
}

Fixed version (ground truth):
private CloseableIterable<OptionalWithCause<LogEntry>> listLogEntries(){
  boolean recursive=false;
  CloseableIterable<OptionalWithCause<LogEntry>> inStorage=null;
  CloseableIterable<OptionalWithCause<LogEntry>> notStorage=null;
  try {
    final CloseableIterable<Resource> actionLogs=getStorage().listResourcesUnderContainer(DefaultStoragePath.parse(RodaConstants.STORAGE_CONTAINER_ACTIONLOG),recursive);
    inStorage=new LogEntryStorageIterable(actionLogs);
  }
 catch (  NotFoundException|GenericException|AuthorizationDeniedException|RequestNotValidException e) {
    LOGGER.error("String_Node_Str",e);
  }
  try {
    notStorage=new LogEntryFileSystemIterable(RodaCoreFactory.getLogPath());
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
  return CloseableIterables.concat(inStorage,notStorage);
}