Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can use 2 spaces before and you get a <code> block. AI should be able to do it for you if you ask it to since its good at transforming between formats.

  public void getEntityWithParents(List<DBEntity> entityList, String id) {
      DBEntity entity = dao.getById(id);
      entityList.add(entity);
      if (entity.getParent() != null) {
          getEntityWithParents(entityList, entity.getId());
      }
  }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: