本文整理了Java中org.jruby.Ruby.newLightweightStopIterationError
方法的一些代码示例,展示了Ruby.newLightweightStopIterationError
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.newLightweightStopIterationError
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:newLightweightStopIterationError
[英]Generate a StopIteration exception. This differs from the normal logic by avoiding the generation of a backtrace. StopIteration is used by Enumerator to end an external iteration, and so generating a full backtrace is usually unreasonable overhead. The flag -Xstop_iteration.backtrace=true or the property jruby.stop_iteration.backtrace=true forces all StopIteration exceptions to generate a backtrace.
[中]生成StopIteration异常。这与正常逻辑不同,因为它避免了回溯的生成。枚举器使用StopIteration结束外部迭代,因此生成完整回溯通常是不合理的开销。标志-Xstop_迭代。backtrace=true或属性jruby。停止迭代。backtrace=true强制所有StopIteration异常生成回溯。
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private IRubyObject returnValue(IRubyObject value) {
// if it's the NEVER object, raise StopIteration
if (value == NEVER) {
doneObject = value;
throw runtime.newLightweightStopIterationError("stop iteration");
}
// if it's an exception, raise it
if (value instanceof RubyException) {
doneObject = value;
throw new RaiseException((RubyException)value);
}
// otherwise, just return it
return value;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private void checkIndex() throws RaiseException {
if (index >= array.size()) throw runtime.newLightweightStopIterationError("stop iteration");
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private void checkIndex() throws RaiseException {
if (index >= array.size()) throw runtime.newLightweightStopIterationError("stop iteration");
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private IRubyObject returnValue(IRubyObject value) {
// if it's the NEVER object, raise StopIteration
if (value == NEVER) {
doneObject = value;
throw runtime.newLightweightStopIterationError("stop iteration");
}
// if it's an exception, raise it
if (value instanceof RubyException) {
doneObject = value;
throw new RaiseException((RubyException)value);
}
// otherwise, just return it
return value;
}
内容来源于网络,如有侵权,请联系作者删除!