org.jruby.Ruby.newSystemStackError()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中org.jruby.Ruby.newSystemStackError方法的一些代码示例,展示了Ruby.newSystemStackError的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.newSystemStackError方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:newSystemStackError

Ruby.newSystemStackError介绍

暂无

代码示例

代码示例来源:origin: org.jruby/jruby-complete

@Override
public Object apply(String file, int line, int col, Object funcBody, Vector paramNames, Vector args) {
  ThreadContext context = container.getProvider().getRuntime().getCurrentContext();
  try {
    if (paramNames != null && args != null) {
      for (int i = 0; i < paramNames.size(); i++) {
        Object o = paramNames.get(i);
        if (o instanceof String) {
          String name = (String) o;
          container.put(name, args.get(i));
        }
      }
    }
    return run(file, line, funcBody);
  } catch (StackOverflowError soe) {
    throw context.runtime.newSystemStackError("stack level too deep", soe);
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

private IRubyObject evalBlockBody(ThreadContext context, Binding binding, IRubyObject self) {
  // This while loop is for restarting the block call in case a 'redo' fires.
  while (true) {
    try {
      return ASTInterpreter.INTERPRET_BLOCK(context.runtime, context, file, line, body, binding.getMethod(), self, Block.NULL_BLOCK);
    } catch (JumpException.RedoJump rj) {
      context.pollThreadEvents();
      // do nothing, allow loop to redo
    } catch (StackOverflowError soe) {
      throw context.runtime.newSystemStackError("stack level too deep", soe);
    }
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

private IRubyObject evalBlockBody(ThreadContext context, Binding binding, IRubyObject self) {
  // This while loop is for restarting the block call in case a 'redo' fires.
  while (true) {
    try {
      return ASTInterpreter.INTERPRET_BLOCK(context.runtime, context, file, line, bodyNode, binding.getMethod(), self, Block.NULL_BLOCK);
    } catch (JumpException.RedoJump rj) {
      context.pollThreadEvents();
      // do nothing, allow loop to redo
    } catch (StackOverflowError soe) {
      throw context.runtime.newSystemStackError("stack level too deep", soe);
    }
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

private IRubyObject evalBlockBody(ThreadContext context, Binding binding, IRubyObject self) {
  // This while loop is for restarting the block call in case a 'redo' fires.
  while (true) {
    try {
      return ASTInterpreter.INTERPRET_BLOCK(context.runtime, context, file, line, bodyNode, binding.getMethod(), self, Block.NULL_BLOCK);
    } catch (JumpException.RedoJump rj) {
      context.pollThreadEvents();
      // do nothing, allow loop to redo
    } catch (StackOverflowError soe) {
      throw context.runtime.newSystemStackError("stack level too deep", soe);
    }
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

private IRubyObject evalBlockBody(ThreadContext context, Binding binding, IRubyObject self) {
  // This while loop is for restarting the block call in case a 'redo' fires.
  while (true) {
    try {
      return ASTInterpreter.INTERPRET_BLOCK(context.runtime, context, file, line, body, binding.getMethod(), self, Block.NULL_BLOCK);
    } catch (JumpException.RedoJump rj) {
      context.pollThreadEvents();
      // do nothing, allow loop to redo
    } catch (StackOverflowError soe) {
      throw context.runtime.newSystemStackError("stack level too deep", soe);
    }
  }
}

代码示例来源:origin: org.jruby/jruby-core

@Override
public Object apply(String file, int line, int col, Object funcBody, Vector paramNames, Vector args) {
  ThreadContext context = container.getProvider().getRuntime().getCurrentContext();
  try {
    if (paramNames != null && args != null) {
      for (int i = 0; i < paramNames.size(); i++) {
        Object o = paramNames.get(i);
        if (o instanceof String) {
          String name = (String) o;
          container.put(name, args.get(i));
        }
      }
    }
    return run(file, line, funcBody);
  } catch (StackOverflowError soe) {
    throw context.runtime.newSystemStackError("stack level too deep", soe);
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@Override
public Object apply(String file, int line, int col, Object funcBody, Vector paramNames, Vector args) {
  ThreadContext context = container.getProvider().getRuntime().getCurrentContext();
  try {
    if (paramNames != null && args != null) {
      for (int i = 0; i < paramNames.size(); i++) {
        Object o = paramNames.get(i);
        if (o instanceof String) {
          String name = (String) o;
          container.put(name, args.get(i));
        }
      }
    }
    return run(file, line, funcBody);
  } catch (StackOverflowError soe) {
    throw context.runtime.newSystemStackError("stack level too deep", soe);
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@Override
public Object apply(String file, int line, int col, Object funcBody, Vector paramNames, Vector args) {
  ThreadContext context = container.getProvider().getRuntime().getCurrentContext();
  try {
    if (paramNames != null && args != null) {
      for (int i = 0; i < paramNames.size(); i++) {
        Object o = paramNames.get(i);
        if (o instanceof String) {
          String name = (String) o;
          container.put(name, args.get(i));
        }
      }
    }
    return run(file, line, funcBody);
  } catch (StackOverflowError soe) {
    throw context.runtime.newSystemStackError("stack level too deep", soe);
  }
}

代码示例来源:origin: org.jruby/jruby-complete

@Override
public Object apply(String file, int line, int col, Object funcBody, Vector paramNames, Vector args) {
  ThreadContext context = runtime.getCurrentContext();
  try {
    // Construct local variables based on parameter names passed in
    String[] names = new String[paramNames.size()];
    paramNames.toArray(names);
    context.preBsfApply(names);
    // Populate values for the parameter names
    DynamicScope scope = context.getCurrentScope();
    for (int i = 0, size = args.size(); i < size; i++) {
      scope.setValue(i, JavaEmbedUtils.javaToRuby(runtime, args.get(i)), 0);
    }
    return JavaEmbedUtils.rubyToJava(evaler.parse(runtime, funcBody.toString(), file, line).run());
  } catch (StackOverflowError soe) {
    throw context.runtime.newSystemStackError("stack level too deep", soe);
  } finally {
    context.postBsfApply();
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@Override
public Object apply(String file, int line, int col, Object funcBody, Vector paramNames, Vector args) {
  ThreadContext context = runtime.getCurrentContext();
  try {
    // Construct local variables based on parameter names passed in
    String[] names = new String[paramNames.size()];
    paramNames.toArray(names);
    context.preBsfApply(names);
    // Populate values for the parameter names
    DynamicScope scope = context.getCurrentScope();
    for (int i = 0, size = args.size(); i < size; i++) {
      scope.setValue(i, JavaEmbedUtils.javaToRuby(runtime, args.get(i)), 0);
    }
    return JavaEmbedUtils.rubyToJava(evaler.parse(runtime, funcBody.toString(), file, line).run());
  } catch (StackOverflowError soe) {
    throw context.runtime.newSystemStackError("stack level too deep", soe);
  } finally {
    context.postBsfApply();
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@Override
public Object apply(String file, int line, int col, Object funcBody, Vector paramNames, Vector args) {
  ThreadContext context = runtime.getCurrentContext();
  try {
    // Construct local variables based on parameter names passed in
    String[] names = new String[paramNames.size()];
    paramNames.toArray(names);
    context.preBsfApply(names);
    // Populate values for the parameter names
    DynamicScope scope = context.getCurrentScope();
    for (int i = 0, size = args.size(); i < size; i++) {
      scope.setValue(i, JavaEmbedUtils.javaToRuby(runtime, args.get(i)), 0);
    }
    return JavaEmbedUtils.rubyToJava(evaler.parse(runtime, funcBody.toString(), file, line).run());
  } catch (StackOverflowError soe) {
    throw context.runtime.newSystemStackError("stack level too deep", soe);
  } finally {
    context.postBsfApply();
  }
}

代码示例来源:origin: org.jruby/jruby-core

@Override
public Object apply(String file, int line, int col, Object funcBody, Vector paramNames, Vector args) {
  ThreadContext context = runtime.getCurrentContext();
  try {
    // Construct local variables based on parameter names passed in
    String[] names = new String[paramNames.size()];
    paramNames.toArray(names);
    context.preBsfApply(names);
    // Populate values for the parameter names
    DynamicScope scope = context.getCurrentScope();
    for (int i = 0, size = args.size(); i < size; i++) {
      scope.setValue(i, JavaEmbedUtils.javaToRuby(runtime, args.get(i)), 0);
    }
    return JavaEmbedUtils.rubyToJava(evaler.parse(runtime, funcBody.toString(), file, line).run());
  } catch (StackOverflowError soe) {
    throw context.runtime.newSystemStackError("stack level too deep", soe);
  } finally {
    context.postBsfApply();
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

throw runtime.newLocalJumpError(RubyLocalJumpError.Reason.BREAK, (IRubyObject)bj.getValue(), "unexpected break");
} catch (StackOverflowError soe) {
  throw runtime.newSystemStackError("stack level too deep", soe);

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

throw runtime.newLocalJumpError(RubyLocalJumpError.Reason.BREAK, (IRubyObject)bj.getValue(), "unexpected break");
} catch (StackOverflowError soe) {
  throw runtime.newSystemStackError("stack level too deep", soe);

代码示例来源:origin: org.jruby/jruby-complete

throw runtime.newSystemStackError("stack level too deep", soe);

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

throw new EvalFailedException(e.getMessage(), e);
} catch (StackOverflowError soe) {
  throw runtime.newSystemStackError("stack level too deep", soe);
} catch (Throwable e) {
  throw new EvalFailedException(e);

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

throw new EvalFailedException(e.getMessage(), e);
} catch (StackOverflowError soe) {
  throw runtime.newSystemStackError("stack level too deep", soe);
} catch (Throwable e) {
  throw new EvalFailedException(e);

代码示例来源:origin: org.jruby/jruby-core

throw runtime.newSystemStackError("stack level too deep", soe);

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

throw runtime.newLocalJumpError(RubyLocalJumpError.Reason.REDO, (IRubyObject)rj.getValue(), "unexpected redo");
} catch (StackOverflowError soe) {
  throw runtime.newSystemStackError("stack level too deep", soe);
} finally {
  context.postEvalWithBinding(binding, lastFrame);

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

throw runtime.newLocalJumpError(RubyLocalJumpError.Reason.REDO, (IRubyObject)rj.getValue(), "unexpected redo");
} catch (StackOverflowError soe) {
  throw runtime.newSystemStackError("stack level too deep", soe);
} finally {
  context.postEvalWithBinding(binding, lastFrame);

相关文章

微信公众号

最新文章

更多

Ruby类方法