@Override public void run() { try (InputStreamReader isr = new InputStreamReader(stream); BufferedReader br = new BufferedReader(isr)) { Thread.currentThread() .setName(StreamEater.class.getSimpleName() + "-" + Thread.currentThread().getId()); String line = br.readLine(); while (line != null) { logger.append(line); logger.append("\n"); line = br.readLine(); } } catch (IOException e) { logger.append(NLS.toUserString(e)); exHolder.set(e); } finally { this.completionSynchronizer.release(); } }
/** * Returns the first item matched by the query. * * @return the first item matched by the query or <tt>null</tt> if there are no matches. */ public E queryFirst() { ValueHolder<E> result = ValueHolder.of(null); limit(1); iterate(r -> { result.set(r); return false; }); return result.get(); }
try { Sirius.LOG.INFO("Loading config: %s", value.group()); result.set(result.get().withFallback(ConfigFactory.load(getLoader(), value.group()))); } catch (Exception e) { Exceptions.ignore(e); Sirius.LOG.INFO("using application.conf from classpath..."); try { result.set(ConfigFactory.load(loader, "application.conf").withFallback(result.get())); } catch (Exception e) { Exceptions.ignore(e);
protected void deleteByIteration(boolean force) throws Exception { ValueHolder<Exception> error = ValueHolder.of(null); iterate(e -> { try { if (force) { indexAccess.forceDelete(e); } else { indexAccess.delete(e); } } catch (Exception ex) { error.set(ex); } return true; }); if (error.get() != null) { throw error.get(); } } }