本文整理汇总了Java中org.apache.lucene.util.IOUtils.reThrowUnchecked方法的典型用法代码示例。如果您正苦于以下问题:Java IOUtils.reThrowUnchecked方法的具体用法?Java IOUtils.reThrowUnchecked怎么用?Java IOUtils.reThrowUnchecked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.util.IOUtils
的用法示例。
在下文中一共展示了IOUtils.reThrowUnchecked方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toString
import org.apache.lucene.util.IOUtils; //导入方法依赖的package包/类
/** compiles to bytecode, and returns debugging output */
static String toString(Class<?> iface, String source, CompilerSettings settings) {
StringWriter output = new StringWriter();
PrintWriter outputWriter = new PrintWriter(output);
Textifier textifier = new Textifier();
try {
Compiler.compile(iface, "<debugging>", source, settings, textifier);
} catch (Exception e) {
textifier.print(outputWriter);
e.addSuppressed(new Exception("current bytecode: \n" + output));
IOUtils.reThrowUnchecked(e);
throw new AssertionError();
}
textifier.print(outputWriter);
return output.toString();
}
示例2: notifyReaderClosedListeners
import org.apache.lucene.util.IOUtils; //导入方法依赖的package包/类
private void notifyReaderClosedListeners(Throwable th) {
synchronized(readerClosedListeners) {
for(ReaderClosedListener listener : readerClosedListeners) {
try {
listener.onClose(this);
} catch (Throwable t) {
if (th == null) {
th = t;
} else {
th.addSuppressed(t);
}
}
}
IOUtils.reThrowUnchecked(th);
}
}
示例3: notifyCoreClosedListeners
import org.apache.lucene.util.IOUtils; //导入方法依赖的package包/类
private void notifyCoreClosedListeners(Throwable th) {
synchronized(coreClosedListeners) {
for (CoreClosedListener listener : coreClosedListeners) {
// SegmentReader uses our instance as its
// coreCacheKey:
try {
listener.onClose(this);
} catch (Throwable t) {
if (th == null) {
th = t;
} else {
th.addSuppressed(t);
}
}
}
IOUtils.reThrowUnchecked(th);
}
}